Create batch file :
for /F “tokens=1,2,3,4 delims=,” %%i in (freshmen09.csv) do dsadd user “cn=%%j %%i,ou=2013,ou=students,dc=[domain],dc=org” -samid %%k -pwd “%%l” -upn %%k@[domain].org -fn “%%j” -ln “%%i” -display “%%j %%i” -memberof “cn=GL 2013,ou=2013,ou=students,dc=[domain],dc=org” -disabled no -mustchpwd yes -hmdrv U: -hmdir “\\[network home directory]\2013\%%k”
Create .csv file contain 4 columns : Last Name, First Name, Username, Password
- Creates a user for each row in the file,
- Puts them into the desired OU,
- Sets the password,
- Adds them as a member of a group,
- Enforces that the password must be changed when the user first logs in,
- Sets the home directory to the appropriate place on our network share.