Reads values from the userAccountControl of the MyerKen Active Directory user account.
Set objHash = CreateObject("Scripting.Dictionary")objHash.Add "ADS_UF_SMARTCARD_REQUIRED", &h40000objHash.Add "ADS_UF_TRUSTED_FOR_DELEGATION", &h80000objHash.Add "ADS_UF_NOT_DELEGATED", &h100000objHash.Add "ADS_UF_USE_DES_KEY_ONLY", &h200000objHash.Add "ADS_UF_DONT_REQUIRE_PREAUTH", &h400000Set objUser = GetObject _("LDAP://cn=MyerKen,ou=Management,dc=NA,dc=fabrikam,dc=com")intUAC = objUser.Get("userAccountControl")If objUser.IsAccountLocked = True ThenWScript.echo "ADS_UF_LOCKOUT is enabled"ElseWScript.echo "ADS_UF_LOCKOUT is disabled"End Ifwscript.echo VBCRLFFor Each Key In objHash.KeysIf objHash(Key) And intUAC ThenWScript.echo Key & " is enabled"ElseWScript.echo Key & " is disabled"End IfNext
This is a VB Script, this can be used by saving the file in .vbs file