In a batch file, create this:

Note that users.txt is the name of the users that were previously created in a .CSV file. "ou=These users" is the name of the OU that needs to exist in your Active Directories Users and Computers. dc= should be the name of your domain controller. "Desc" represents description.


for /F "eol=; tokens=1,2,3,4,5,* delims=," %%i in (users.txt) do dsadd user "cn=%%j %%i,ou=These users,dc=rcordner,dc=local" -samid %%k -upn %%k@rcordner.local -fn %%j -ln %%i -display "%%j %%i" -desc Staff -pwd Test1234! -mustchpwd yes -hmdir "\\rcordner.local\home\%%k" -hmdrv n: 


for /F "eol=; tokens=1,2,3,4,5,* delims=," %%i in (users.txt) do mkdir "\\rc-server\home\%%k"


for /F "eol=; tokens=1,2,3,4,5,* delims=," %%i in (users.txt) do subinacl /verbose=1 /subdirectories /grant=rcordner.local\%%k=F