Change your Computer's Name with PowerShell

Written by Eric Wyatt (last updated December 7, 2020)

2

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. ...

MORE FROM ERIC

Getting Started with the Mail App

The Mail app is a great way to access your e-mail. This tip shows you how to get started quickly and easily.

Discover More

Configuring Windows' Secret Start Menu

You can quickly access either Command Prompt or PowerShell by using the Win+X shortcut key command. But which one is ...

Discover More

Keeping the Scroll Bar

Scroll bars are helpful in showing that there is more information to be seen. By default, Windows 10 hides scroll bars, ...

Discover More
More WindowsTips

Passing Parameters to a PowerShell Script

Like the older batch-file processor, PowerShell can accept parameters. This allows for flexibility in your script. This ...

Discover More

Using PowerShell to Find Your Wireless Signal Strength

Wi-Fi signal strength is important for faster, more consistent data transfers. You can use PowerShell to gain a more ...

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
Comments

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}] (all 7 characters, in the sequence shown) 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 2 + 2?

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. https://windows.tips.net/T005830_Changing_a_Computers_Name.html


2020-12-07 07:56:20

Jim

Eric,
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?

Thanks
-Jim


Newest Tips