Page 1 of 1

Need to know if this is possible

Posted: 09 Nov 2009 14:53
by sxekjb
I need to rename quite a lot of machines over the domain. Right now I'm doing this using the netdom command

Code: Select all

netdom renamecomputer mycomputer /newname:new_name /ud:domain\user /pd:password


-I'm having to go through this step every time. I'm wondering if there's a way to create a batch that will automatically fill in the old and new computer name possibly from a list, and if possible maybe perform the same task for an entire list of machines over the network.

Thank you :)

Posted: 12 Nov 2009 08:33
by sxekjb
Figured it out.

Created notepad list of names with the old name as token=1 and new as token=2

Then:

Code: Select all

FOR /f "tokens=1,2 delims= " %%G IN (names.txt) DO netdom renamecomputer %%G /newname:%%H /userD:domain\username /passwordD:password /userO:domain\username /passwordO:password