Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am the system admin for a small business (120 employees) and I am looking at an easy way to rename all of the computers in the office to a more uniform naming convention.

I have tried playing with the "netdom renamecomputer" line in command prompt but that doesn't seem to work at all. Possibly because are not on a Group Policy. We set our computers up using a WORKGROUP and then have our employees connect to work servers using Remote Desktop connections.

Is there a Powershell tool or a program that i can download to help me rename all the computers in our network?

P.S. we have mostly Win7 machines but recently we have added about 20 Win8 machines (in case that matters)

share|improve this question
up vote 7 down vote accepted

I haven't used this myself, but a quick google brings this command back a lot

WMIC ComputerSystem where Name=COMPUTERNAME call Rename Name=NewName

If the computer name has dashes or other special characters you need to quote the computer name

WMIC ComputerSystem where Name="COMPUTER-NAME" call Rename Name=NewName


share|improve this answer
Thank you so much Bali C. I had tried that a few times but to no avail. The problem was that i needed to put the " " in. Now, i just need to figure out how to do this remotely from my PC so i wont have to create a batch file and run it on everyone's computer. – MaylorTaylor Jan 29 '13 at 18:11
Use PSExec.exe to execute wmic remotely. You can download psexec from sysinternals, here: – Mark Allen Jan 29 '13 at 21:37
@MaylorTaylor No worries :) As Mark suggested, use psexec, that will work well. – Bali C Jan 30 '13 at 9:30
For bonus ease of use, use the %COMPUTERNAME% environment variable for querying for the old name. – mroach Aug 1 '13 at 22:44

In powershell you can use something similar to Bali's, but I would use powershell's get-wmiobject function instead, but this does the same thing. The difference is that the powershell cmdlets can be called remotely if need be (though you would have to configure your environment for psremoting, well worth it imo), plus you wouldn't have to worry about passing credentials through like you do w/ PSExec (try mapping a drive under diff creds remotely w/ psexec!), anyway, the command would be

PS C:\Users\admin> $(gwmi win32_computersystem).Rename("Bldg-SerialNum")

and this could even be automated by grabbing the serial # of the machine from wmi also, so you could either deploy your .ps1 scripts to each machine or run a single script from your own machine that grabs each machine name from a list, connects to it, gets the serial number, and changes the name accordingly.

share|improve this answer

Powershell 3.0 (Windows 8) introduced the Rename-Computer cmdlet. Example:

Rename-Computer -NewName NewComputerName -Restart

This will rename the computer and immediately restart.

TechNet Documentation.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .