Thursday, July 14, 2011

User Must Change Password at Next Logon–pwdLastSet–PowerShell Script

This PowerShell script can be used update the pwdLastSet (User Must Change Password at Next Logon) value in Active Directory.  You can use either “0” or “-1” to enable to disable this option:

0 to enable the User must change password at next logon option
-1 to disable the User must change password at next logon option

Script: 

image

Output:

image

Download:

www.sivarajan.com - http://www.sivarajan.com/scripts/User_Change_Password.txt

TechNet Gallery - http://gallery.technet.microsoft.com/scriptcenter/030d1ff1-df99-47fe-b9c3-ecd4d98ffd7d

More scripts - http://portal.sivarajan.com/search?q=script+powershell&max-results=20

1 comments:

Mate,
is it possible to run the script only for a selected users. I need to force the password changes only for 1000 users in my network. They are all in same OU, however this OU contains more than 5000 users. Please help, thanks

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More