Change your Computer's Name with PowerShell

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

Search the Web Using the Run Dialog Box

The Run dialog box allows you to quickly run or start a program using quick keystrokes. The Run dialog box can also help ...

Discover More

File Explorer Shortcut List

Windows includes built-in combination keystrokes or shortcuts that can help you work faster. File Explorer's specific ...

Discover More

Setting Time Limits for Windows 10 Users

If your computer is set up in crowded environment, it may be helpful to establish times that an account can be used. You ...

Discover More
More WindowsTips

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

Introduction to PowerShell

PowerShell is found on all modern Windows computers. You might think of it as the next step up from the command line .bat ...

Discover More
Subscribe

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

View most recent newsletter.

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}] 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 five more than 7?

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
Subscribe

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.