Uses the userAccountControl to enable a user account.
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 ThenobjUser.Put "userAccountControl", intUAC XOR ADS_UF_ACCOUNTDISABLEobjUser.SetInfoEnd If
This is a VB Script, this can be used by saving the file in .vbs file