Search

How to rename computer name using PowerShell

In this lesson, we will learn how to rename a Windows Server 2022 computer using PowerShell. This is a must have skill, because it is easy to rename a computer using PowerShell for servers running Server Core Operating System versions.

Step 1 - After logging-in as administrator in your Windows Server, enter option 15 to move to PowerShell console from SConfig console. Please refer below image to know how to move to PowerShell console from SConfig console.

rename-computer-name-powershell-01.jpg

 

Step 2 - If you want to know the current computer name (host name), use hostname command as shown below to know the current computer name. In this case, current computer name is a randomly generated one, during installation. We need to change this computer name to some meaningful name, so that we can manage the server in a better way.



hostname

 

rename-computer-name-powershell-02.jpg

 

Step 3 - To change the computer name using PowerShell, use Rename-Computer PowerShell cmdlet, as shown below.



Rename-Computer -NewName OmniSecu-Serv04 

 

rename-computer-name-powershell-03.jpg

 

Step 4 - Now, we need to restart the computer to apply the computer renaming in effect. Use "Restart-Computer" PowerShell cmdlet, as shown below to restart the computer.



Restart-Computer

 

rename-computer-name-powershell-04.jpg

 

Step 5 - Once the server computer has restarted, again use the "hostname" command to verify the computer name is changed, as shown in below image.



hostname

 

rename-computer-name-powershell-05.jpg

Written by Jajish Thomas.
Last updated on 9th April, 2022.

 

Related Tutorials
Introduction to Windows Server 2022
New features of Windows Server 2022
Hardware requirements for Windows Server
Different editions of Windows Server 2022
Difference between Server Core and Server with Desktop experience (GUI)
How to install Windows 2022 Server
How to use search functionality in Windows Server 2022
How to hide or unhide search box
How to add This PC icon to desktop in windows 2022
How to add Network icon to desktop in windows 2022
How to rename computer name in Windows 2022
How to rename computer name using PowerShell
How to configure IPv4 Address in Windows 2022
How to configure IPv6 Address in Windows 2022
How to configure IPv4 address Windows 2022 using PowerShell
How to configure IPv6 address Windows 2022 using PowerShell
How to shut down or restart Windows 2022
How to sign out from Windows Server 2022
How to run a program or app as administrator