Solved

How to bulk change home drive / directory mapping in Active Directory ?

Posted on 2014-07-18
4
2,818 Views
Last Modified: 2014-07-30
Hi people,

Can anyone here please assist me with how to successfully change the user Active Directory home folder attributes with powershell in bulk ?

because at the moment every single AD account H: drive is mapped to \\OLDFileServer\ADUsername statically when the service desk team creates the users. I got around 1850 user account to change over the weekend due to the new file server is replacing the old one.

From the Group Policy preference (user settings) I have already set the H: drive to the new file server, but i don't know how to automatically change the AD attributes for those 1850 AD accounts effectively to the new file server.

Thanks.
0
Comment
4 Comments
 
LVL 95

Accepted Solution

by:
Lee W, MVP earned 200 total points
Comment Utility
Of course, test first, but try:

$User = Get-ADUser -Filter * -SearchBase "DC=ad,DC=company,DC=com"
Set-ADUser -Identity $User.SamAccountName -HomeDirectory  \\NewFileServer\$User.SameAccountName -HomeDrive H;

Open in new window

0
 
LVL 16

Assisted Solution

by:Spike99
Spike99 earned 150 total points
Comment Utility
You can also select multiple users, then:  right click on the selected accounts > click on properties.   As long as the multiple selection includes only user accounts, you can change certain settings on multiple users at the same time.

Of course, with so many users, it may be too time consuming to do it that way so the script may be the way to go.

To change the home folder mapping, you would use the %username% variable, which AD will convert to the actual user's name when you apply the change.

See attachedMutliple-Items.JPG
0
 
LVL 24

Assisted Solution

by:Sandeshdubey
Sandeshdubey earned 150 total points
Comment Utility
Migrate User Home Folders to a New File Server with all Security Permissions and Bulk Changes for Home Folder Paths.http://dilshansaminda.wordpress.com/2012/01/06/migrate-user-home-folders-to-a-new-file-server-with-all-security-permissions-and-bulk-changes-for-home-folder-paths/
0
 
LVL 7

Author Closing Comment

by:Senior IT System Engineer
Comment Utility
Thanks !
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

772 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

10 Experts available now in Live!

Get 1:1 Help Now