Jun 22, 2015

Batch - Join Domain Batch File

This is a batch file to automatically join the computer to the specified domain, the purposes of the batch file as below :-

  • To avoid typography error in domain name.
  • To avoid mismatch username and password when joining to domain.
Syntax of the command :
 
netdom join %COMPUTERNAME% /domain:[domain name] /userd:[domain\username] /passwordd:[password]

 
  • %COMPUTERNAME% = Computer's Name, a variables.
  • [domain name] = The actual domain name (eg. google.com)
  • [domain\username] = The actual domain's username (eg. google.com\administrator)
  • [password] = The username's password.
Of course you can put in a lot of things into this batch file such as checking the computer's name validity (eg. length of the name, cross checking with a database file to match the S/N etc.)

Note that the "netdom" command is NOT AVAILABLE in standard Windows 7 OS, it must be installed separately. Download & install Microsoft Remote Server Administration Tools (RSAT).

Once installed you need to enable the "AD DS Command-Line Utility" before you can start using the "netdom" command.

No comments:

Post a Comment