Local user account password age

J

jacksneed2000

I need to retrieve the password age on user accounts defined locally on
windows machines (not in AD). I figured out lastlogin below works, but
passwordlastchanged doesn't, as it only works for domain AD queries
according to MSDN.

Set usr = GetObject("WinNT://PCName/Admi­nistrator, user")
wscript.echo "Administrator last login: " & usr.LastLogin
wscript.echo "Administrator password age: " & _ usr.PasswordLastChanged


So, how can I automate enumerating this entry on a local pc, whether in
..net, vbscript, c++, whatever! Please note, I cannot use 3rd party
utilities, being in a government facility - I really need a
scripting/programming solution. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top