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:
@echo off
IF "%COMPUTERNAME%"=="COMPANYNAME-CITY-JOHN" SET NEWNAME=NEWNAME-HERE
IF "%COMPUTERNAME%"=="COMPANYNAME-CITY-BOB" SET NEWNAME=NEWNAME-HERE2
... more machines ...
IF NOT "%NEWNAME%"=="" NETDOM renamecomputer member /newname:%NEWNAME% /userd:USER-TO-PERFORM-RENAME-UNDER /password:PASSWORD-FOR-THAT-USER
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.
- Create a group in AD-- say "Computer Rename Complete".
- Modify the permission on the group to include "Domain Computers - Write / Add Self as Member"
- In the simplistic batch-file script above add the line at the end:
IF NOT "%NEWNAME%"=="" NET GROUP "User Creation Script Complete" /DOMAIN /ADD %COMPUTERNAME%$
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):
Option Explicit
Dim objWMIService, strNewName, objShell, objNetwork
Set objShell = CreateObject("WScript.Shell")
Set objNetwork = CreateObject("WScript.Network")
' Obtain the service tag
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
For Each objSMBIOS in objWMIService.ExecQuery("SELECT * FROM Win32_SystemEnclosure")
strNewName = objSMBIOS.SerialNumber
Next
' Check for empty string
If (strNewName = "") Then WScript.Quit
' Does the computer need to be renamed?
If (UCase(strNewName) <> UCase(objNetwork.ComputerName)) Then
objShell.Run "NETDOM renamecomputer member /newname:" & strNewName & " /userd:USER-TO-PERFORM-RENAME-UNDER /password:PASSWORD-FOR-THAT-USER"
End If
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.)