Solved

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

Posted on 2014-07-18
4
3,054 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
ID: 40205080
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
ID: 40205150
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
ID: 40210852
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
ID: 40230678
Thanks !
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…

778 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