Local user account password age

  • Thread starter Thread starter jacksneed2000
  • Start date Start date
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!
 
Back
Top