Change Username in Powershell on Windows 11

Introduction – What is the Powershell?

Changing the Username can be done using the Powershell on Windows. The Powershell is a Command Line Interface / Terminal used on Windows to automate certain tasks or to administrate your devices.

Start the Powershell as Administrator

To use the Powershell in Windows 11, click on Windows-Start, type “Terminal” now importantly: right click and click “Run As Administrator“. This is essential, as you will only be able to change Usernames as an Admin.

Now click Yes (or enter your Admin credentials if necessary) to confirm the Admin rights.

Now once you’re inside the Terminal, you should see a Tab (similar to a browser Tab). On top it should say “Administrator: Windows Powershell”. If this is not the case, go to the “+” sign and open a new Powershell Tab.

The Command: Rename-LocalUser

Once you’re inside the Powershell, you can finally change the username.

This is possible using a Powershell command called “Rename-LocalUser”.
But we also need the following two parameters to tell the command what we want to do

  • -Name
  • -NewName

As the names of these parameters imply -Name is the current Username of the User you want to change and NewName is the new Username you want to give the user.

Now it’s your turn, you need to write the command with the correct Parameters, here’s an example:

Rename-LocalUser -Name "john" -NewName "johndoe"

In this example the Username of the existing User “john” will change to “johndoe”.

And that’s it, your new Username should change the next time you log out of your account!

If you also want to change your local users password, there is a great tutorial by “Pureinfotech” here:
https://pureinfotech.com/change-account-password-powershell-windows-10/

Leave a Comment