Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

updating user home directory

$
0
0

I am about to move our file server between data centers and then rename it. Once that is done I will need to update everyone's home drive path. I have no way to test my script below but I know each piece works on its own.

Anyone see any issues or something I am missing?

 

Get-ADUser -Filter * -SearchBase OU=Accounts,DC=Domain,DC=Domain | `

ForEach-Object {Set-ADUser -Identity $_.SamAccountName -HomeDirectory "\\Servername\$($_.SamAccountName)`$"}


Viewing all articles
Browse latest Browse all 6937

Trending Articles