PowerShell, Rename Computer Remotely

In keeping with the last few posts this is a short but handy IT tool in a short but (hopefully) handy post. Computer naming conventions are a common practice in almost every organization. However, sometimes a machine gets misnamed or moved and we need to rename it. Of course you could send a tech or sysadmin to lay-on-hands and change the computer name through the GUI but that is time consuming and if the machine is at a remote site impractical. Luckily PowerShell can help us out here.

This is a single command that could be used in conjunction with others to say do more complex changes. For instance with a CSV file you might do a column of old names and one of new names and using a ForEach loop rename an entire location or group of machines.

When successful the command will return a warning that the remote machine needs a reboot.

I’ll leave this one at this and perhaps build up from here in future posts.

Leave a Reply

Your email address will not be published. Required fields are marked *