Netdom to Save the Day

Netdom to Save the Day

Netdom is one of the best ways to automate adding a client to a Windows domain, forget having to mess around with sysprep or manually adding clients to a domain when you can run a simple batch script.

My dilemma for the need of NETDOM spawned out of Altiris issue which was none of the Altiris deployed images were not adding to the domain, even though they were being forced to by the Altiris client. This was driving me nuts that the majority of the deployed computers were just sticking to the workgroup.

The main solution is sysprep images, which is what should be done in the long run but redoing an image is messy and annoying if I want it all done in a day. After remembering that Altiris Deployment Solution allows the remote execution of scripts and batch commands, I crafted up a job that solved my problem and deployed them all in a day.

The batch I used for this was a simple one liner:

netdom join %computername% /Domain:mydomain.com.au /UserD:UserName /PasswordD:Password /reboot:20

For those using Altiris Deployment Solution, here is how I staged the job:

  • Copy the Netdom.exe to the client's local hard-drive.
  • Execute the batch script, as the local service.

Altiris note: This job was executed after another job, which applied the client's computer using the token %NAME%.

You will find NETDOM.exe on your Windows Server 2003 CD, in Support Tools installation. Which you can find in Support\Tools\, once installed navigate to Program Files\Support Tools and you will find the single file you need right there.

3.242425
Average: 3.2 (33 votes)

Excellent Tip

rstaats's picture

Don't know why I didn't think of this one on my own, but this is a problem I consistantly have as well. Great solution.

Now I just need to find a was to encrypt or hash that password to that it's not sitting in my job as plain text. :) I think NETDOM has that capability, but i've never used it that way before.

Great post, thanks!

Windows XP Service Pack 2 Support Tools

riva11's picture

Quote:
You will find NETDOM.exe on your Windows Server 2003 CD, in Support Tools installation.

Just for your info, this tool is also part of Windows XP Support Tools , also available with a direct download at this page : Windows XP Service Pack 2 Support Tools