Is there a way from either the computer management console or the command line to determine when a user's password will expire?
Note: I'm asking this questions for a server that is not part of a domain.
This can be achieved by the DOS/Batch command
If you were on a domain you would need to add the switch
This will list the most important details of that account, including the expiry date of the user password.
If you're chasing the same problem I had in the past, users want better warning of when their password is going to expire, especially when they're away from a typical PC. The following is the script I run every 72 hours (3 days) to e-mail warnings.
Set those four configuration lines appropriately for your environment. Modify other parts as necessary.
PS may complain if the script isn't signed. I signed mine using (I have a code signing certificate):
Then I created a simple Scheduled Task, triggers every 72 hours, action is to run
Note: The computer this script is run on must be a member of the domain, and must have the "Active Director module for Windows PowerShell" installed. You can run
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site.
Would you like to answer one of these unanswered questions instead?