- Paste the below given script in Notepad
- Save it with .bat (Windows Batch File) file
@echo off cls echo Creating Accounts echo ------------------ for /f "tokens=1-3" %%A in (userlist.txt) do (dsadd user "CN=%%A,ou=Network,dc=mailserver,dc=com" -fn %%B -ln %%C -display "%%B %%C" -upn %%A@thenguyen.local -pwd Passw0rd1 -mustchpwd No -disabled no) echo ------------------ pause
ou -> Organization Unit (given as “Network” in the script, replace it with your Organization Unit name)
dc -> Domain Controller (given as “mailserver” in the script, replace it with your Domain Controller name, donot chnage the value dc=com)
Create a file with name “userlist.txt” and save all the user details in the below mentioned format.
raju Raju Rao kalyan Chakra Naidu chiru Chiru Reddy
First Column -> User Name
Second Column -> First Name
Thirm Column -> Last Name
Place both the batch and userlist.txt files in same folder.
Run the batch file. The users mentioned in userlist.txt will be created.
Note: User must have Administrator privilages to run this batch.
