Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large number of PCs that are joined to domain and I want to move them over to so they are no longer a member of Can I do this with a script?


share|improve this question
up vote 10 down vote accepted

Sure thing. The NETDOM utility is "your friend" in this case. I've deployed a startup script in the "old domain" to cause computers to disjoin their existing domain and join a new domain.

Some docs on NETDOM are here:

You'll need to create a user in the source domain and destination domain with rights to add/remove computers from the domains for NETDOM to use.

NETDOM move %COMPUTERNAME% /d:NEWDOMAIN /ou:DN_of_destination_OU_in_new_domain /ud:admin_user_in_new_domain /pd:admin_pw_in_new_domain /uf:admin_user_in_old_domain /pf:admin_pw_in_old_domain /reboot

So, let's say that the new domain is "", the computer needs to go into the "OU=Desktop,OU=Client Computers,DC=newdomain,DC=com" OU, the user w/ rights to remove comptuers from the old domain is "oldadmin" (with the password P@ssw0rd), and the user with rights to add the computer to the new domain is "newadmin" (with the password dr0wss@P).

NETDOM move / /ou:OU=Desktop,OU=Client Computers,DC=newdomain,DC=com /ud:newadmin /pd:dr0wss@P /uf:oldadmin /pf:P@ssw0rd /reboot

BTW: If you want to forcibly disjoin the computer from its current domain w/o actually contacting a domain controller there, drop me an email. I have a utility that I've written (but don't have it handy right now) to tell the computer it's no longer a member of a domain w/o contacting the DCs in that domain. It's quick-and-dirty, but it works if you need to get a machine out of a domain and have local Administrator access but no domain rights... heh heh...

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.