Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Powershell script to add home folder to users in Active Directory

Powershell script to add home folder to users in Active Directory

Powershell script to add home folder to users in Active Directory

Hello -- I have been banging my head for a while now, trying to figure out how to write a powershell script with the quest powershell extensions, which will:

1) Query AD for users in a specific OU that don't have a home folder specified.
2) For each found user, add an entry, pointing U: to \\server\share
3) Create the actual folder on the server at \\server\share\%username% with full control for administrators and modify permissions for the %username%.
4) Schedule the script to run on a 2003 SP2 Domain Controller...

I am going to go out and buy a powershell for dummies book later today, and would appreciate it (if i get a response that is) if you could annotate the solution / script with explanations. This will help me learn how pshell scripting works. A VBScript to do this may do, and I'm pretty close with one, but I'd prefer to do this in powershell, since everyone is switching to pshell scripting. Thanks in advance!

RE: Powershell script to add home folder to users in Active Directory

I don't have a box to test however:

1) get-qaduser | where homefolder $null
2) map drive U yourself to the share root then:
pipe it into a New-item u:\%username% -type directory
3) Not looked at permissions
4) Schedule it on the file server containing the share would be easier...then it is a local creation.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close