Removing Home Folder Redirection(WIP)
Synopsis: Misc Notes on cleaning up folder redirection with the intention of switching to OneDrive folder backups..
Published April 1st, 2026
Last Modified: May 11th, 2026
Intro: Occassionaly I must reverse some 'legacy' folder redirection policies in a tenant before implementing OneDrive. This can come in different flavors and has been a recent pain in the ass.
Published April 1st, 2026
Last Modified: May 11th, 2026
Intro: Occassionaly I must reverse some 'legacy' folder redirection policies in a tenant before implementing OneDrive. This can come in different flavors and has been a recent pain in the ass.
Quick Run Down
-
1.) Home Directory
2.) Local Folder Redirection (Removal)
3.) Troubleshooting
Home Directory
- Export current config just in case: AD Reports
- Group Based Removal - PowerShell
$users = get-adgroupmember -identity "TargetGroup"
foreach($user in $users) {
GET-ADUSER -Identity $user -Properties HomeDirectory, homeDrive
SET-ADUSER -Identity $User -clear homeDirectory,homeDrive
}
Local Folder Redirection (Removal)
-
Auditing the current status of userprofiles with LFR in place can be difficult. I've recently created this script to help with that.
- Copy the script locally to the workstation before running.
- Additional parameters can be added to help with success - "-ExecutionPolicy Bypass -NonInteractive -WindowStyle Hidden"
LFR Audit - Is written in such a way to be ran in the system level context, from the local machine. It should run rather quickly and output a file to the specified share listing all the profiles w/ folder redirection in place.
Additional Script Tips
Troubleshooting
- Profile can be removed completely by powershell: PS
Get-CimInstance -ClassName Win32_UserProfile | Where-Object {$_.LocalPath -like "*UserName*"} | Remove-CimInstance