Naming your computer is almost as exciting as naming your baby or new puppy. Almost. However, it shouldn’t have to be as difficult.
Whether you recently purchased a new computer, or upgraded from a previous version to Windows 10 (and the name you assigned your computer didn’t make it through the upgrade), this script will help you easily rename the computer.
Not to mention, if you’re an MSP or IT professional managing a ton of devices, renaming them in a systematic way will certainly help you keep track of all the devices you monitor and maintain on a monthly basis.
This script changes the system hostname and restarts the computer automatically. The hostname is changed both locally and over the network.
This script will work for both a local and remote computer, hopefully making your work life a little easier.
The Script:
Atera does not guarantee the integrity, availability, security, virus-free, safety, lawfulness, non-infringement, rights’ status, or functionality of the scripts. The use of the shared scripts is at your own risk. Scripts are provided “AS IS”. *
# Chanage the computer name in Windows
Rename-Computer -newname "$HQ-MikeC-PC"
# Restart the computer for rename to take effect
if ($ToRestartTypeYes -eq 'yes') {
Restart-Computer -Force
}
How to change a hostname on Windows?
Changing a hostname on Windows 10 is pretty straightforward! Use this script to get it done in no time.
This script changes the system hostname and restarts the computer automatically. The hostname is changed both locally and over the network.
How to change Windows computer name?
Since Windows 10 was introduced, changing a computer name has become much easier.
Use this script to effortlessly change a Windows computer’s name.
This script will result in changing the computer name as seen in Active Directory.
How to rename a Windows system locally or on networks?
This script changes the system hostname effortlessly. The hostname is changed both locally and over the network.
How to change computer names programmatically or with a script?
Changing computer names with a script is really easy, especially with this script! This script will result in changing the computer name as seen in Active Directory.
Technical Notes:
1. The computer will restart automatically for the changes to take effect.
2. This script uses a variable named $HQ-MikeC-PC to specify the computer name. If this variable does not contain a value, or is not inherited from another source, this script may produce unexpected results.
3. This script will result in changing the computer name as seen in Active Directory. This may require rejoining or other interaction from an administrator after running this script.
Explore our shared script library
The all-in-one IT management platform that will take your IT operations to the next level!