Uses the userAccountControl to determine whether a user account is enabled or disabled.
Const ADS_UF_ACCOUNTDISABLE = 2Set objUser = GetObject _("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")intUAC = objUser.Get("userAccountControl")If intUAC AND ADS_UF_ACCOUNTDISABLE ThenWscript.echo "The account is disabled"ElseWscript.echo "The account is enabled"End If
This is a VB Script, this can be used by saving the file in .vbs file