Script to Join a Domain

Posted on 2004-11-23
Last Modified: 2010-09-08
Here is the scenario,

Establishing a new domain for a company, want all the user computers (mostly XP) to run a script to join to the new domain created.

Avoid going to each system and doing those steps manually.

It will be really great if a script is available.

Question by:deemehtani
    LVL 41

    Expert Comment

    LVL 3

    Author Comment

    Well, I already know this, but the problem is that it works only with windows XP, what I am looking for is something that would work for XP, 2000 and also 98, not so worried about the 98 systems.

    let me know, if you come across something that is universal, (I have tested netdom, doesn't work with 2000)

    LVL 1

    Assisted Solution


     Even after you have copied netdom.exe onto the 2000 box, didn't it work?

    If yes, please ignore the below message.


     In your script copy netdom.exe to the local systems Windows directory

     copy "\\UNC\netdom.exe"  "c:\windows\system32\"


    netdom join %computername% /Domain:<Domainname>/UserD:<Username> /PasswordD:<Password> /OU:"OU=<Containername>,DC=Test,DC=com,DC=au" /REBoot:20

    This will add you computer onto the domain and then reboot.
    LVL 41

    Expert Comment

    LVL 41

    Accepted Solution

    the common thread I see, is you have to use the correct version of netdom.exe

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Let’s list some of the technologies that enable smooth teleworking. 
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now