Reputation: 87
I have a PowerShell script which does the following on Windows 7 computers:
As a next step, I want to periodically check if the password saved on the server is still valid. For now, I am using ValidateCredentials from System.DirectoryServices.AccountManagement.PrincipalContext (see Powershell To Check Local Admin Credentials) but it involves to unencrypt the password and send it back to the computer just for this purpose.
Do you see any better way to check if password is still valid avoiding to use clear text password ? Is it possible to compare some hash, or anything else ?
Regards.
Upvotes: 2
Views: 1402
Reputation: 127603
You can check the attribute PasswordAge
and do a little math to see if the last time the password was changed was the time you set the password.
Upvotes: 2