Change your Computer's Name with PowerShell

by Eric Wyatt
(last updated December 7, 2020)


When it comes to your computer, there are typically two names associated with it. One is your account name; this is the name you have assigned to your account when you log into your computer. The second is the actual computer name. When you look at a network with multiple computers connected, you might see a wide variety of names, such as 'Wilma Desktop' or something more confusing such as 'WIN-AW09062006.' These are the names associated with specific computers connected to the same network as your computer.

What if you want your computer's name to change? Perhaps you inherited someone else's previous computer, and it still has their name, or you want something a bit more unique. It is important to understand that what we are referring to here is the name given to your computer. While you might have multiple accounts or users using your computer, the computer's name does not change with regards to the user logged in on that computer.

We have discussed previously how to change a computer's name, in which we used the Control Panel to change the name. As with most things on a computer, there is more than one way to do something. Another way to do this is by using PowerShell.

There are two things to keep in mind before changing your computer's name using PowerShell. First, write down your computer's current name. If something does not work correctly after changing your name you can change it back if needed. Second, these steps assume that you have PowerShell set to be shown in the secondary Windows menu. If not, look at this article explaining how to configure PowerShell to be shown on that menu.

  1. Right-click on the Start button. Windows displays the secondary Windows Start menu.
  2. Choose Windows PowerShell (Admin). (Make sure it is the Admin option, not the Windows PowerShell option without the Admin privileges.) Windows displays the User Account Control asking if you want to allow changes to be made.
  3. Click Yes. The dialog box disappears, and the PowerShell command prompt window is displayed. The window will say Administrator in the top-left corner.
  4. At the command prompt, type the following and then press Enter. You can also copy and paste the command directly into the PowerShell command prompt. You need to change the last part of the command, "Computer-Name," to what you want your computer's name to be.
  5. Rename-Computer -NewName "Computer-Name"
  6. Close the PowerShell command prompt window.
  7. Restart your computer for the name change to take effect.

It is important to remember that if you are part of a network administered by an IT administrator, you may not be able to modify or change your name. If that is the case, contact your system administrator to see if they can assist you.

 This tip (13808) applies to Windows 10.

Author Bio

Eric Wyatt

Eric Wyatt is a swell guy (or so his friends tell him). He is a formally trained designer and branding expert, bringing a wide range of skills to his Tips.Net articles. ...


Left-Handed Mouse

If you're left-handed, using a computer that by default is setup for right-handed users can be tricky. With Windows 10, ...

Discover More

Changing Your DNS Server

Your DNS server is usually set by your Internet provider. You can change the default DNS to another server easily in ...

Discover More

Disable the "Get even more out of Windows" Message

Concerned or bothered by the "Get even more out of Windows" or "Welcome to Windows" full-screen notifications? With a ...

Discover More
More WindowsTips

Use PowerShell to Find Your Computer Serial Number

When you need your computer's serial number you can look it up without looking on the outside of the box. Use PowerShell ...

Discover More

Counting the Number of Files or Subfolders Using PowerShell

Do you need to determine the number of files or subfolders there are in a folder? You can use PowerShell to quickly count ...

Discover More

PowerShell Input and Output

When dealing with a scripting language like PowerShell, one of the first things you need to learn is how to get data into ...

Discover More

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 5 - 1?

2020-12-16 12:21:38

David H.

Hi Jim. I believe what you're seeing is your "username" or "account" (which happens to be "User" in your case.) As Eric stated above, your computer can have multiple "User Names" or "Accounts" but can only have one "Computer Name". For example, if your family consists of Jane and John Doe, you could have your computer name set as "DoeFamilyComputer" with two separate "accounts" (or "usernames") such as "Jane" for one account name and "John" for another account name. Reading Mr. Dysert's article here may help.

2020-12-07 07:56:20


Using Win7 Pro 64-bit. It has PowerShell. My "tree" looks like this path: Computer>Local Disk C:>Users>User. So I believe my computer name is user?
Right? Is this what you are referring to?


Newest Tips

FREE SERVICE: Get tips like this every week in WindowsTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.