I've inherited this stupid name convention:
COMPANYNAME-CITY20090724 or COMPANYNAME-CITY-JOHN
It doesn't tell me anything about the location (floor, department). John left the company months ago. Computers from one city moved to another city, but the name hasn't been changed.
How can you rename 100+ computers when you want to create a new naming convention?
Sure thing. The NETDOM utility is "your friend" in this case. You can use a startup script to rename computers.
Some docs on NETDOM are here:
I could see a really simplistic script like this:
Once all the computers are renamed you can take the startup script away. It shouldn't be too "expensive" to run on computers that have already been renamed. If you were worried about that you could do the "trapdoor" technique whereby the script ends with the computer placing itself into a group that has been denied rights to execute the script.
You'll see that group "grow" member computers as it runs on each machine. To stop the script from running on computers where it's already run, add a permission to the GPO that assigns the startup script "Computer Rename Complete - Deny Apply Group Policy". Then the script will run once on each machine.
What are your destination names going to be like? If you're like me and like Dell service tag numbers you could do something like this (in VBScript):
That script could just run all the time, and would constantly rename computers that weren't named based on their service tags... heh heh. (I'm not sure that I'd actually do that, and if I did I'd put more sanity checking in the script.)
You could do this through PowerShell. In Excel, make a file with two columns, one for the old name, one for the new name. Add a header row oldname and newname. Save it as a CSV (mylist.csv) then run this in powershell:
...core code came from here.
This is a weakness of naming schemes which attempt to describe location, owner, function, etc. Things change. So you end up either renaming computers often (and rebooting every time!), or having a naming scheme which falls into disrepair as time passes.
May I suggest the description field? alt text http://lh3.ggpht.com/BryanLockwood/SKbN8OdozVI/AAAAAAAAAVU/C3ZeLX0_wGc/%5C%5Ccojones.org%5Cfiles%5Cusers%5Cbryan%5CDesktop%5CComputerDescription.PNG?imgmax=512
You can list computers and their descriptions easily: alt text http://lh6.ggpht.com/BryanLockwood/SKbN8HBTywI/AAAAAAAAAVc/vu65Fm4R5aM/%5C%5Ccojones.org%5Cfiles%5Cusers%5Cbryan%5CDesktop%5Ccmd-example-descriptions.PNG?imgmax=512
More on this at my blog.
If you are not familiar with the Netdom command line tool then try using the Netdom rename computer GUI from colosify.
It will help you rename multiple computers on your domain by uploading a .csv file without the need to remember or learn any command line code or create any scripts.
This GUI saved me a lot of time.