Solved

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

Posted on 2014-07-18
4
3,296 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
[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
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 17

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

763 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