r/ScriptSwap • u/phletch • Dec 25 '12
[Request] Change Domain-joined Windows PC name using batch
Does anyone know if I can rename Windows PCs using batch in a domain environment? I am successful in writing to the registry values below, but the changes are not reflected in AD or DNS (windows server 2003), but echoing %computername% on the machine looks correct. Can still log in to domain after making these changes. The answer may be to do this manually, but I'm looking to do this to over 150 machines... really hoping for some automation.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\ComputerName\ComputerName] /v "ComputerName"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Tcpip\Parameters] /v "NV Hostname"
View all comments
Show parent comment
1
u/nojp Dec 26 '12
This is how I have done this before as well. Some more links:
http://technet.microsoft.com/en-us/library/cc788029(v=ws.10).aspx http://support.microsoft.com/kb/325354