Rename a computer with PowerShell

In this “how” tutorial I will explain how to rename a computer in PowerShell.

Using PowerShell allows you to go more empty than going through the graphical interface which requires going through several configuration windows.

Rename a computer with PowerShell

In a PowerShell prompt use: Rename-Computer

The PowerShell command to rename a computer is Rename-Computer.

Enter the following command to rename a computer:

Rename-Computer -NewName "New_Computer_Name"
Rename-Computer

Restart the computer

In consideration of the new name, restart the computer. Use the Restart-Computer command in PowerShell

Check the name change with the command: hostname

After reboot in a command prompt use: hostname to display the computer name.

Romain Drouche

Romain Drouche

System Architect | MCSE: Core Infrastructure

An IT infrastructure expert with over 15 years of hands-on experience. Currently serving as a Systems and Network Project Manager and Information Systems Security (ISS) Lead, I leverage my expertise to ensure the reliability and security of technological environments.

GHinM▶