How to join a computer to domain from command line

by admin on June 4, 2009

We can join a computer to a domain from system properties window. Some times we may need to do this from command line or from a batch file without any user interaction. We can use the tool Netdom.exe in such scenarios.

Below is the command we need to run for joining the machine to a domain.

netdom.exe join %computername% /domain:DomainName /UserD:DomainName\UserName /PasswordD:Password

Here Username and Password should be of a  the domain specified in /domain switch. The user should have privileges to join a computer to the domain.

How to remove a computer from a domain using netdom?

You can run the below command to remove a machine from the domain.

netdom.exe remove %computername% /domain:Domainname /UserD:DomainName\UserName /PasswordD:Password

Download Netdom.exe

{ 2 comments… read them below or add one }

gazza99 August 27, 2012 at 5:38 am

this is not a tool available in windows 7….

is not recognized as a command in command prompt

Reply

yogeshkuamr September 19, 2012 at 4:18 am

i want to join a computer with domain via command, is it possible to do plz give reply

Reply

Leave a Comment

HTML tags are not allowed.

Previous post:

Next post: