Configures the domain password for a user account to ensure that the password will never expire.
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000Set objUser = GetObject _("LDAP://cn=myerken,ou=management,dc=fabrikam,dc=com")intUAC = objUser.Get("userAccountControl")If ADS_UF_DONT_EXPIRE_PASSWD AND intUAC ThenWscript.Echo "Already enabled"ElseobjUser.Put "userAccountControl", intUAC XOR _ADS_UF_DONT_EXPIRE_PASSWDobjUser.SetInfoWScript.Echo "Password never expires is now enabled"End If
This is a VB Script, this can be used by saving the file in .vbs file