Posted in
Hosting & IIS7,
Windows Powershell,
Windows Server |
1 Comment | 10,806 views | 02/03/2010 12:13
You have to set “Password never expires” for some active directory users like IIS or SCVMM users. To do this with Powershell, we’ll simply use “userAccountControl” property with Powershell.
1
2
3
| $User = [ADSI] "LDAP://CN=$Username,$CustomerOU,$FQDN"
$User.Put("userAccountControl", "65536")
$User.SetInfo() |
$User = [ADSI] "LDAP://CN=$Username,$CustomerOU,$FQDN"
$User.Put("userAccountControl", "65536")
$User.SetInfo()
65536 means “Password never expires”. Be careful with LDAP name.