Powershell script for setting password expiry

Posted by Pierre E on Server Fault See other posts from Server Fault or by Pierre E
Published on 2012-12-05T05:02:14Z Indexed on 2012/12/05 5:08 UTC
Read the original article Hit count: 459

Due to mistakes by the helpdesk staff, I found that over a 100 user accounts in my company AD have been set so that their passwords never expire. To avoid the situation in which all these users suddenly find themselves unable to log in, I want to run a script to set the password expiry to a specified date.

I'm using Quest AD cmdlets, but I've only used powershell for simple scripts to get lists of users. The attribute I'm trying to modify is 'PasswordStatus' and I want to set those with this attribute set as "password never expires' to a specific date. Not much of a scripting guy, so any help in this would be most welcome.

© Server Fault or respective owner

Related posts about active-directory

Related posts about scripting