Join PC's to Domain via Script

Discussion in 'Active Directory' started by Faisal Zia, Sep 29, 2008.

  1. Faisal Zia

    Faisal Zia Guest

    I am upgrading about 100 desktops. Currently I have windows XP pro
    envoirnment. New PC's will have the same. Is there a script that I can use
    that will allow me to join multiple computer to my domain, instead of going
    to each computer and joining them manually?
    Faisal Zia, Sep 29, 2008
    1. Advertisements

  2. Hello Faisal,

    How do you install the machines or did you get them preinstalled?

    Best regards

    Meinolf Weber
    Meinolf Weber, Sep 29, 2008
    1. Advertisements

  3. Jorge de Almeida Pinto [MVP - DS], Sep 29, 2008
  4. Faisal Zia

    Faisal Zia Guest

    We have our own image that we put on to the computer and then deploy them
    Faisal Zia, Sep 30, 2008
  5. Faisal Zia

    Marcin Guest

    make it part of postinstall process - as Jorge has suggested, this can be
    accomplished by running a script invoking NETDOM within a context of a user
    with ability to add computer accounts to a target OU...

    Marcin, Sep 30, 2008
  6. Faisal Zia

    Al Mulnick Guest

    Not sure you need psexec, do you?
    If you have netdom local to the machine, you can use netdom to do the work
    for you. If you need netdom to do the work remotely, you can do that as
    well (i.e. have netdom on a server and run the command against a remote host
    works fine, but remember that personal firewalls are not your friend from
    that network perspective).

    Several imaging applications also allow this to be done as part of the build
    process. MDT (Microsoft's freely available solution accelerator) does this
    as an example.

    You can find more information for netdom syntax here although there is a lot
    of it on the net available as well:


    "Jorge de Almeida Pinto [MVP - DS]"
    Al Mulnick, Sep 30, 2008
  7. Meinolf Weber, Sep 30, 2008
  8. Faisal Zia

    SGriffi Guest

    Hope someone can assist me. Using netdom and its working fine. When i add
    teh /OU string i get error 234 "failed attemp to rename computer" any ideas's

    my command is as follows
    - netdom join ad-test5 /Domain:domain
    /UserD:xxxx /PasswordD:xxxxxx /Verbose /REBoot

    all one line.
    thanks in advance

    SGriffi, Mar 26, 2009
  9. Hello SGriffi,

    You can redirect the new created computer accounts to the OU direct with:

    redircmp "OU=Computers,OU=Legal,OU=company,OU=UserAccounts,DC=mydomain,DC=tld"

    After that remove the /OU from the script.

    Best regards

    Meinolf Weber
    Meinolf Weber [MVP-DS], Mar 27, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.