Add and remove Windows 2000 server computer accounts
Top  Previous  Next


[Settings_Begin]
BatchSettings.Delimiter=;
BatchSettings.MarkerCol=5
//BatchSettings.Debug=Yes

// NetBIOS domain name of domain that listed machines should join
SET ToJoin=D2                   
// User account used to make the connection with the domain specified by /Domain  (the domain admin account)
SET UserD=%ToJoin%\administrator
// Password of the user account specified by /UserD (password for domain admin account)
SET
 PwD=password                 

// Name of the workstation or member server to be joined
SET ToBeJoined=%col1%
// User account used to make the connection with the machine to be joined (workstation local admin account)
SET UserO=%ToBeJoined%\administrator
// Password of the user account specified by /UserO (password for workstation local admin account)
SET
 PwO=%col2%

// OU in which to create machine account, RFC1779 format, here domain=d2.acme.com, ou=MyOU
SET OU=ou=MyOU,dc=d2,dc=acme,dc=com
[Settings_End]

// Machines section: NetBIOS DC name of domain to join

[Machines_Begin]
\\EDU8      NT PDC    
[Machines_End]

[Batch_Begin]
Data.Loop   
 dos netdom join %ToBeJoined% /domain:%ToJoin% /OU:"%OU%" /userd:%UserD% /passwordd:%PwD% /usero:%UserO% /passwordO:%PwO%   
Data.Endloop   
[Batch_End]

[Undo_Batch_Begin]
Data.Loop   
 dos netdom remove %ToBeJoined% /domain:%ToJoin% /userd:%UserD% /passwordd:%PwD% /usero:%UserO% /passwordO:%PwO%   
Data.Endloop   
[Undo_Batch_End]

// Data section: NetBIOS names of machines to join the domain in column 1 and local admin passwords in column 2
// Listed machines must be on

[Data_Begin]
machine1;password1;;;;
machine2;password2;;;;
machine3;password3;;;;
[Data_End]


Required

netdom.exe