meph’s blog

2009/03/30

How to rename multiple computers in a Windows Domain

Filed under: Windows — Tags: , , , — Michael @ 13:23

The netdom.exe utility is included in the Windows XP Support Tools (Support\Tools folder on the Windows XP CD-ROM). It can be used for e.g. renaming computers in a Windows-domain. I used it in a script some months ago, when our department decided that “more generic” computer names are better than using the primary users last name as computername (:S).

When you have to rename multiple computers via a batch script, it makes sense to have some list with the old and new names. I did this in Excel. The command line I used with netdom in order to rename a computer was:

netdom.exe renamecomputer <OldComputername> /newname:<NewComputername>
/userd:<Domain-Admin> /passwordd:<Password of Domain-Admin>
/usero:<Domain-Admin> /passwordo:<Password of Domain-Admin>
/reboot:<Time before rebooting in seconds>

(For more detailed information about netdom and a description of the parameters I refer to this and this article.)

In the first step I created a column at the beginning of my excel sheet and filled it with “netdom.exe renamecomputer”. The second column consists of the old computername. In the third column I typed “/newname:”, the fourth column is filled with the new computername and so on. So you see that I “built” each line of my rename-script with Excel. At last you just have to save it as CSV, open it with a text editor, replace all separators with spaces and check the basis of the script for errors.

Advertisements

1 Comment »

  1. […] be done with netdom.exe. It is part of the Windows XP support tools. I wrote about it in another post. For a description how to use it I suggest you read this article. Instead of simply changing the […]

    Pingback by RIS/WDS – post installation script (pt. 1) « meph’s blog — 2009/10/22 @ 16:18


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: