Windows provides very useful GUI tools in order to manage user and administrator passwords. But Windows is not a simple GUI operating system and provides command-line tools in order to change the password of specified user and administrator. This can be very useful if the user or administrator has lost his password.
Display Current User
Before resetting the current user password it is very good habbit to list the current user or current user name. This prevent accidents to reset another user passwrod which is logged in currently. The
whoami command can be used to display current user which comes from “Who Am I?” question.
The output express that the current system or hostname is
desktop-1qktvv and username is
In order to reset the password of another user first the user should be list printed. The
net user command can be used to list all local users of the system.
Reset Current Active User Password
After learning the current active username we can change its password by using the
net user command with the username. The syntax of resetting the current active user password is like below.
net user USERNAME PASSWORD
- USERNAME is the username we want to reset password.
- PASSWORD is the new password we want to set.
In the following example we reset the password of the user
q23aer2r@!! which can be assumed secure. Please use longer password with different character types like lowercase letter, uppercase letter, number, special character etc.
net user ismail q23aer2r@!!
Reset Another User Password
We can change another user password without logging in to its sessions. But tin order to change antoher user password we requre administrative privileges which means the current user should be in the Administrators group to have Administrative privileges. If we do not have the Administrator privileges or do not started the command prompt (MS-DOS) as administrator we will get the following
Access is denied error.
net user john q3rQwer3r4@.-
In the following tutorial opening the command prompt or MS-DOS as Administrator is explained. So first use this tutorial to open command prompt as Administrator.
Use the same command in the elevated command prompt in order to change another user password.
net user john q3rQwer3r4@.-
Reset Administrator Password
The administrator user is a special used to administrate the system . The defualt administrative user name is
Admnistrator . The Administrator password can be reset like a normal user where the command prompt should be opened as Administrator which is described below.
net user Administrator 34rq^F3q4f..@232das
Use PowerShell To Reset User Password
Even it is not yet as popular as
net user PowerShell provides the
Set-LocalUser command in order to manage user. The Set-LocalUser command can be used to reset password for the specified user. The Set-LocalUser command use the
-Password option in order to specify the new password. But there is a trick where the -Password is required as secure string which can be provided with the
Set-LocaUser -Name john -Password (ConvertTo-SecureString "MyP@ssw0rd" -AsPlainText -Force)