how to run a script after user change password of windows account (windows server family)
hi I want to write a script that run after user (limit or administrator) change or reset account password!
December 10th, 2010 4:07pm

Whether these are local accounts or accounts in Active Directory, there is nothing that can trigger a script to run when the user changes a password. The only possibility would be a scheduled task that runs a script periodically looking for recently changed passwords. For domain users, the script would check the value of the pwdLastSet attribute for all users to see if it corresponds to a date since the last time the script ran. If the accounts are local, the script would check the passwordAge property. Assuming an Active Directory domain, a VBScript program could use ADO to query AD for all users whose password has changed since a given date. See this link for details: http://www.rlmueller.net/ADOSearchTips.htm The filter would be similar to the example in the link, which is: strFilter = "(&(objectCategory=person)(objectClass=user)" _ & "(pwdLastSet>=127204308000000000))" except the value would be calculated to correspond to date in the recent past. If the scheduled task runs every 2 hours, the value would correspond to a time 2 hours in the past. The page linked above has a link to VBScript code that converts any date/time into the corresponding 64-bit value for the filter. As you can see, this is not an easy task. Richard MuellerMVP ADSI
Free Windows Admin Tool Kit Click here and download it now
December 11th, 2010 12:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics