How Old is the Admin Password

Here’s a quick one-liner to find out how old the administrator password age (in days) is on a remote machine.

This requires RPC/DCOM access to the remote computer. Or use PowerShell remoting with Invoke-Command:


4 thoughts on “How Old is the Admin Password

  1. Pingback: Get Local Admin Group Members in a New Old Way | The Lonely Administrator
  2. Great on-liner, I use it continually in our enterprise. For readability in one of my scheduled tasks that sends out overview emails, I added formatting to limit the returned data to one decimal point (boss no likey long numbers). My modification below:

    “{0:N1}” -f (([adsi]”WinNT://COMPUTERNAME/administrator”).passwordage.value/86400)

Comments are closed.