Solved

Easiest way to Create a bulk amount of home directorys in ad

Posted on 2014-02-03
5
268 Views
Last Modified: 2014-02-03
Trying to setup home directories for entire workforce. I know how to do it manually but got to be a easier way of doing it.

I could create an script but not sure if that is the best way of doing it.
0
Comment
Question by:jyoung127
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 22

Expert Comment

by:Joseph Moody
ID: 39830549
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 250 total points
ID: 39830881
The suggestion that Jmoody suggested would be acceptable for any new Users that would be created. It is recommended for easy creation to create User Templates for specific needs. However, for what you need it is probably easiest to script this to get all of the users needed.

TXT - You will need to get a list of users "sAMAccountName" and add them to a txt file. Example below...
jsmith
wills
miked
etc....

If you want to get all of the users in your domain into a txt file you can use the below syntax...
get-aduser -filter * -properties * | select sAMAccountName | out-file "c:\users.txt"

Open in new window


Once you have your users in the txt file do the following...

import-module activedirectory
$userlist = get-content "c:\users.txt"
foreach ($item in $userlist) {$item; get-aduser -identity $item | set-aduser -HomeDrive "X:" -HomeDirectory "\\servername\Share\%username%\"

Open in new window


I have tested this in my lab and it worked correctly. I would test adding 1 user to the txt file and then running the script to ensure that it is doing what you need it to.

That should all you need to do.

Will.
0
 

Author Comment

by:jyoung127
ID: 39830909
Is there a step by step guide on doing this?
0
 

Author Comment

by:jyoung127
ID: 39830966
Will thanks for that information that is what I was looking for.

I tried the following but every time I run it in power shell it does not take hold:

import-module activedirectory
$userlist = get-content "c:\users.txt"
foreach ($item in $userlist) {$item; get-aduser -identity $item | set-aduser -HomeDrive "U:" -HomeDirectory "\\sos-fs1\homedir$\%username%\"

Anything I am missing?
0
 

Author Comment

by:jyoung127
ID: 39831102
Ok so I figured an even easier way of doing it. I highlighted all users in AD and went to Properties and then checked the home directory and used \\sos-fs1\homedir$\%username%
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
A hard and fast method for reducing Active Directory Administrators members.
In this Micro Tutorial viewers will learn how to restore their server from Bare Metal Backup image created with Windows Server Backup feature. As an example Windows 2012R2 is used.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question