Solved

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

Posted on 2014-02-03
5
260 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
  • 3
5 Comments
 
LVL 21

Expert Comment

by:Joseph Moody
Comment Utility
0
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 250 total points
Comment Utility
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
Comment Utility
Is there a step by step guide on doing this?
0
 

Author Comment

by:jyoung127
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now