I think you can, but it is not straight forward. Especially if you want to move computer to a new domain, you need to use NetDom plus registry tool, so you need a good registry guy to pinpoint the reg key for you, they should be in:
Oh yea, you asked if this could be put into a script. Sure it could. Are you renaming multiple servers. Do they all have the same common username and password as the built in administrator?
I'm only looking to change the name on member servers, I've to create a script which will quickly rename about 400 servers which are all imaged. the administrator name and password will be the same on all servers. Don't worry about domain names or anything, none of these servers are going into a domain, their for a project my company is doing.
If you do it via batch file you could create one batch file , and a list of hostnames or ipaddresses and the new name in a text file like such:
my_servers_to_rename.txt
REM the order is old_name space new_name
server1 serverA
server2 serverB
server3 serverC
server4 serverD
server5 serverE
Rename_servers.bat
REM This batch file will take input from the my_servers_to_rename.txt file and rename servers. Note that this batch file is fully dependant on DNS being able to resolve the old computer names.
for /f "tokens=1-2" %%a in (my_servers_to_rename.txt) do echo NETDOM RENAMECOMPUTER %%a /NewName:%%b /UserO:Administrator /PasswordO@ssw0rd /Force /REBoot:25
REM This is untested so play with it first but you should get the idea. Hope this helps...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.