Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

Thanks

share|improve this question
add comment

1 Answer 1

up vote 9 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 "newdomain.com", 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 /d:newdomain.com /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
add comment

Your Answer

 
discard

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.