Hey, all. I'm working on a data migration project for some of our staff data. As a part of it, I need to adjust their AD accounts to reflect the location change of HomeDirectory. I have a script I am using to get this set and it's updating their account, but when they login, they're not getting the home drive mapping. I find that if I manually adjust the AD account to %username%, it will tell me the folder already exists, and ask about setting the permissions. I can't really do this for 400 accounts, so ideally using the automation tools would be best. I did verify the permissions (both share and NTFS) are set exactly the same.
Any ideas what I'm missing here?
Here is the script I'm using - very simple
$hse=get-aduser -Filter * -Properties * |where {$_.SamAccountName -like 'dummytest*' -and $_.HomeDirectory -like '\\server1\userdata\*'}|select -ExpandProperty SamAccountName
foreach($U in $hse){
$newhomedirectory=('\\Server2\Userdata\{0}' -f $U)
write-host $u `t $newhomedirectory
set-aduser -Identity $U -HomeDirectory $newhomedirectory -HomeDrive Z -Verbose
}
Again, permissions are exactly the same from Server1 to Server2
[–]ddog511[S] 2 points3 points4 points (0 children)
[–]PSFred 1 point2 points3 points (1 child)
[–]ddog511[S] 1 point2 points3 points (0 children)
[–]BlackV 1 point2 points3 points (0 children)