search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Setting “Password never expires” for Active Directory Users with Powershell
Posted in Hosting & IIS7, Windows Powershell, Windows Server | 1 Comment | 10,807 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()

65536 means “Password never expires”. Be careful with LDAP name.


Comments (1)

Scotty

May 14th, 2010
21:37:52

Hi Yusuf,

Thanks for sharing this. I too am an avid Powershell User (for AD) and occasionally blog on it as well. I’m planning on covering some modify related operations in AD using Powershell one of these days, and will try and cover this as well!

Cheers,
Scotty



Leave a Reply