This batch files populates Active Directory with organizational units, user accounts, computer accounts, local and global groups, and manages membership of those groups. This is accomplished by calling a number of other batch files to perform specific tasks : createOU.bat, createUsers.bat, createComputers.bat.
The following script obviously assumes a certain design in the Active Directory : an Organizational Unit logical structure, users with membership to groups, therefore also a logical structure of somain local and global groups, etc. This is described in Active Directory Design and Implementation.
REM summary script for AD, Users, Groups, Computers and ACL setup/config @echo off REM -- 1 -- check that all required batch files exist IF NOT EXIST createOU.bat GOTO err1 IF NOT EXIST createUsers.bat GOTO err2 IF NOT EXIST createComputers.bat GOTO err3 REM -- 2 -- run batch files ___ MAIN ____ call createOU.bat call createUsers.bat call createComputers.bat REM call resetACL.bat REM -- 4 -- exit echo batch process finished GOTO batchend REM -- handle errors -- ___ ERROR HANDLING ____ :err1 ECHO missing : createOU.bat GOTO err :err2 ECHO missing : createUsers.bat GOTO err :err3 ECHO missing : crateComputers.bat GOTO batchend :err ECHO %0 did not complete succesfully. EXIT /B 1 :batchend EXIT /B 0