Solved

Using Powershell to bulk change the Home folder path of AD objects based on %username" ?

Posted on 2014-07-25
2
3,288 Views
Last Modified: 2014-07-30
Hi All,

Can anyone here please assist me in creating the Powershell script to change the Each user Home Drive attributes with powershell from the old value of \\OldFileServer\JohnD into \\NewFileServer\JohnD that can be applied for all my user AD accounts in the Domain\Company Users ?

Thanks.
0
Comment
2 Comments
 
LVL 14

Accepted Solution

by:
Justin Yeung earned 500 total points
ID: 40219526
get-aduser -filter {homedirectory -like "\\OldFileServer\*"} -properties HomeDirectory | % {set-aduser $_ -homedirectory "\\NewFileServer\$($_.SamAccountName)"}
0
 
LVL 7

Author Closing Comment

by:Senior IT System Engineer
ID: 40230675
thanks !
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A brief introduction to what I consider to be the best editor for PowerShell.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
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 …

830 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