Sunday, March 14, 2010

Automatically move AD computers into new/appropriate OU

If you know the admin password of all new computers, you can use netdom.exe to join machine
remotely, and at the same time put it in exact ou where you want to put it.
NETDOM JOIN comp1 /DOMAIN:WINDOM /UO:LocalAdmin /PO:LocalAdminPassword /UD:WinDom\DomAdmin /PD:DomAdminPassword /OU:"OU=MyComps,dc=dom,dc=com"
comp1 = remote computer to join the domain
windom = domain to join
localadmin = local administrator of comp1 computer
localadminpassword = localadmin 's password
windom\domadmin = domain account with rights to join machine to domain
DomAdminPassword = windom\domadmin's password

No comments: