Setting PwdLastSet with VBScript
Learn why setting PwdLastSet may not be working
John Savill
June 2, 2017
1 Min Read
![Setting PwdLastSet with VBScript Setting PwdLastSet with VBScript](https://eu-images.contentstack.com/v3/assets/blt07f68461ccd75245/blt8ce8b13232611427/661cf1934b89ac1e2d4070c0/security-2168233960720_0_4.jpg?width=1280&auto=webp&quality=95&format=jpg&disable=upscale)
Q. I'm setting PwdLastSet to 0 with VBScript but users are not being prompted to set password at logon. Why?
A. To force users to reset their password the pwdLastSet attribute must be set to long 0 rather than the VBS default 0. Therefore you need to use the following:
usr.Put "pwdLastSet", CLng(0)
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like