How to Change Windows 11 password via Command Prompt or PowerShell

In Windows 11, users can change or reset their passwords through the Windows Settings app or Control Panel.

There are other ways to change an account’s password in Windows. For example, suppose you have a local account. In that case, you can also use PowerShell or Command Prompt to reset your account password.

A good reason to reset or change a local account password in Windows 11 is if the account has been compromised or the password is no longer secret. You can then simply change it to avoid further problems.

Using the Windows Settings app is the easiest way to reset an account’s password for new users. However, suppose you are familiar with the Command Prompt or Windows PowerShell. In that case, you can also use these utilities to change or reset your password.

How to change Windows 11 password via Command Prompt or Terminal

Change Windows 11 password via Command Prompt

Click the Start button to open the Start menu. In the search window type: Terminal, click on the “Windows Terminal” result, and click “Run as administrator”.

Start Windows Terminal as Administrator

You can now open a Command Prompt tab through Windows Terminal. A Command Prompt is called “Command Prompt” in Windows Terminal.

Click on the down arrow and click on “Command Prompt” in the list. A new tab will now open in the Windows Terminal window.

Open command-prompt in Windows Terminal

To change the password of a specific local account, you must first know what the username of this account is. You can look it up by using the command:

net user

And confirm with the enter key. You will now see a list of accounts present in Windows 11. Type the username in the following command with quotes if the account contains spaces.

net user <username> *

You can now enter a new password for the local account using the Command Prompt.

change password of useraccount using command prompt in Windows 11

Change Windows 11 password via PowerShell

Above I have shown you how to change a password in Windows 11 via Command Prompt.

Another way to change or reset a password with commands is through PowerShell. Windows Terminal can run PowerShell commands through the PowerShell console tab.

Open Windows Terminal. By default, the PowerShell tab is selected. Then run the commands below to display a list of users in Windows 11.



Take a note of the user name. You will need it. You need to set some variables. You need to modify this variable first. You enter these commands one by one.

$password = Read-Host "Type the new password" -AsSecureString
$UserAccount = Get-LocalUser -Name "<username>"
$UserAccount | Set-LocalUser -Password $password

Change local password using PowerShell

You have now successfully changed the Windows 11 password of a specific user account via PowerShell.

Leave a Comment

Your email address will not be published.

Scroll to Top