Solved

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

Posted on 2014-07-18
4
2,932 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
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 tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

920 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