I use the following command to create 15 user accounts:
FOR /L %i in (1,1,15) DO dsadd user "cn=Grade 6 Student %i,ou=Accounts Student,OU=School Name, dc=curric,dc=schoolname,dc=wan" -samid g6%i -upn g6%i@curric.schoolname.wan -fn "Grade 6" -ln "Student %i" -display "Grade 6 Student %i" -pwd 1234 -disabled no
And it works well. I've added the following to the end, to try and provide the user's home drive settings:
-hmdrv H: -hmdir "\\servername\2013 Students\%username%"
That fills in the Home Folder fields in the ADUC user profile tab nicely, but substitutes %username%
for my logged in account name (the account name I'm logged in with when I run the dsadd
command) and not the user account name I create.
Is there a way I can get it to name the home folder as the created user account name and not the name of the account used to run the dsadd
command?