Check Windows Last Password Change in CMD or PowerShell
The password for Windows ensures the security of your PC, as it is used to log in to your computer for use. It is one of the best practices to monitor who changed the password and when it was changed, especially when multiple individuals use your PC. Similarly, in a networking environment with multiple connected computers and some people having administrative privileges, tracking password changes can prevent disruptions to the network.
Knowing who changed the password and when it was changed can help detect and remove networking problems, such as people being unable to log in to their computers or someone disrupting the network.
We can check whether the issue is due to an expired password or something related to an incorrect password. This can be done in CMD or PowerShell. To check the last password change in Windows using CMD or PowerShell, follow the steps given below.
1. Using CMD
The “net user” command helps to identify by whom and when a password was changed, as well as its nature. It is helpful in networking or when multiple people are using the same computer. To check the last password change in Windows using CMD, follow these steps:
1.1 For a Single PC
- Search for “cmd” in the Windows search bar.
- Right-click and Run it as administrator.
- Run the following command
net user %username%
Replace “%username%” with the relevant username of your PC.
1.2 For domain-joined PC
For a domain-joined PC, you will need to log in from a domain-joined computer with administrative powers and follow these steps.
- Search for “CMD” in the Windows search bar.
- Run it and Run the following command
net user %username% /domain
Here, Make sure that you change “%username% and domain” to the correct information.
The domain can be found by running the following command in cmd
echo %userdomain%
So, These are the steps you can follow and check the Last changed password information in Windows PC and Domain-Joined PC as well. For a server, you have to use Windows PowerShell.
2. Using Windows Powershell
PowerShell offers a wide variety of built-in commands suitable for networking and gathering information about a computer using Windows. One such command is “Get-ADUser,” which is used to obtain information about the last changed password. To learn about a Windows user’s last password change using Powershell, follow these steps:
- Search for “Windows PowerShell” in the Windows search bar.
- Right-Click and click on “Run as Administrator”.
- Now, Type the following command
- And press Enter, The Last changed password information will be given for the specified user account.
Get-ADUser -Identity [username] -Properties * | Select-Object -Property *passwordlastset
Here, Replace [username] with the respective server username.