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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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.

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.
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


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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server Apps

From novice to tech pro — start learning today.