how do i create a script to create active directory user home folders

how do i create a script to create active directory user home folders
Robert FettenAssociate Director, ITAsked:
Who is Participating?
 
bcdudleyCommented:
Forgot to add, you will need to add the directories and set permissions manually when doing it this way.

Use a batch file with
CD \Corpoffc\Policies
md user1
md user2
md user3

Open in new window

etc...

Then use

cacls e:\sc-home\ /t /g "domain admins":f
cacls e:\sc-home\ /t /e /g "System":f 
cacls e:\sc-home\ /t /e /g "Creator Owner":f 
For /d %%f IN (*) Do cacls %%f /t /e /g %%f:f

Open in new window


to set permissions.
0
 
Glen KnightCommented:
You don't need to, when you create the user it will create the homefolder in the location you specify in the home folder property
0
 
Kevin HaysIT AnalystCommented:
I usually do folder redirection and write login scripts for other network drivers and printers.  I have my users used to using the Documents and My Documents to store their files.

Kevin
0
 
bcdudleyCommented:
net user user1 [usr1] /ADD /fullname:user1 /scriptpath:netlogon.bat /Profilepath:\\srv-0\user1 /Domain

Open in new window


Will add a user named "User".
Logon name will be "user1"
logon script will be "netlogon.bat"
user profile directory will be "srv-0\user1 "

Modify it to your needs.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.