How to join a Server/Computer to a Windows Domain from Command Line

Top Tip! Click here to run a Free Performance scan

If you're new here, you may want to subscribe to Windows Reference RSS feed Thanks for visiting!


You can join a Computer or a Member server from the command line usinf the the “netdom” command. This I should say is simpler than the right-click my computer thing. Just one single command will do…

The following procedure should work in Windows Server-2008, Windows Server 2003, Windows Vista, Windows XP. Although, you need the Administrator pack/Support Tools to be installed to get the netdom utility in Windows Server 2003 and Windows XP.

To download the support tools for Windows XP SP2, click here

To download the Administrator pack for Windows Server 2003, click here 

1. Click Start – Run (in Windows Server 2008/Vista, Start-Search and type “Run”)

2. From the command prompt type

C:\Users\administrator> netdom join client1 /domain:hq.wr.com /userd:administrator /passwordd:******

Syntax is

netdom join <ComputerName> /domain:<DomainName> /userd:<UserName> /passwordd:*****

Where:
ComputerName is the name of the server that is running the Server Core installation.
DomainName is the name of the domain to join.
UserName is a domain user account with permission to join the domain.
NOTE: Ensure you have the primary DNS server set to your Domain Controller

3. When prompted to enter the password, type the password for the domain user account specified by UserName.

4. Restart the computer for the changes to take effect.

C:\Users\administrator> shutdown /r /t 0

  • Share/Bookmark

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically each day to your feed reader.

Trackbacks & Pingbacks

No trackbacks/pingbacks yet.

Comments

netdom is not available in vista 64-bit

Windows 7 and Vista both have their own NETDOM.EXE, for 32-bit and 64-bit separately.

You have to install:

Install RSAT (After you have extracted the tools): (took me awhile to find the link)

http://www.microsoft.com/downloads/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d&displaylang=en

start /w pkgmgr /n:%SystemDrive%\Install\RSAT\Windows6.1-KB958830-x86.xml

Enable some RSAT tools (including NETDOM)

start /w pkgmgr /iu:RemoteServerAdministrationTools-Roles-AD-DS-SnapIns;RemoteServerAdministrationTools-Roles-AD-DS;RemoteServerAdministrationTools-Roles-AD;RemoteServerAdministrationTools-Roles;RemoteServerAdministrationTools

You will then have a “c:\windows\system32\netdom.exe” that supports the ‘older’ Netdom syntax.

HOWEVER, IF YOU MOVE THE ‘NETDOM.EXE” FROM THE ‘SYSTEM32′ SUB-DIR IT WILL NOT WORK???!!
IT WILL JUST ‘EXIT’ UPON EXECUTION??

BUT , if you WANT to move it, which i did. you have to do ’something’ EXTRA.

To whatever sub-dir you move the RSAT NETDOM.EXE to :

1) FOR EXAMPLE, create a sub-dir called : %temp%\EN-US

2) COPY /Y “%SYSTEMROOT%\SYSTEM32\EN-US\NETDOM.EXE.MUI” “%TEMP%\EN-US

Then if you execute NETDOM.EXE from “%TEMP%” you should ’see’ the familiar ‘help’
messages..

NOTE: I have not, as of Dec 8, 2009 actually TESTED the FULL ‘moved’ NETDOM.EXE functionality,
but WILL in the next day or so,.

ALSO, someone made the comment that if it was moved’ to another compouter it would not work also,
I will verify that statement also.

Hope this helps, as i DONT like the Powershell approach..

J P Morgan james_p_morgan@hotmail.com

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)