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.

Last Change Password Information on CMD
Last Change Password Information on CMD

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

  1. Search for “cmd” in the Windows search bar.
  2. Right-click and Run it as administrator.
    Opening CMD
    Opening CMD
  3. Run the following command
net user %username%

Replace “%username%” with the relevant username of your PC.

Last Password information in cmd
Last Password information in cmd

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.

  1. Search for “CMD” in the Windows search bar.
  2. 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:

  1. Search for “Windows PowerShell” in the Windows search bar.
  2. Right-Click and click on “Run as Administrator”.
    Opening Windows PowerShell
    Opening Windows PowerShell
  3. Now, Type the following command
  4. 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.

Checking Password information through Windows PowerShell
Checking Password information through Windows PowerShell
ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.