Disable GPO folder redirection.

Microsoft

Not sure if this is the right place to ask this. I have a large Hospital organization with 1000 plus end users that is going to migrate to OneDrive. Currently they are using folder redirection. After the migration they want to disable this. Goal is to leave the files in the destination folder from the redirection and prevent the files from being downloaded back to the client machines. They are running into the following problems per testing.

 

"When we tested the removal of this policy, the files from the ‘%USERNAME%\Desktop’ were copied locally to C:\%USERNAME%\Desktop on next login. If we change the bottom setting to “Leave the folder in the new location when policy is removed”, the file redirection (Windows Explorer link) remains active."

 

Based on this documentation, this is expected. Best Practices for Folder Redirection in User Data and Settings Management | Microsoft Docs

 

"The problem with enabling “Leave the folder in the new location when policy is removed” is that the redirected folders remain redirected (e.g. Desktop is still redirected to our server share Users\%USERNAME%\Desktop), when we would like to break/remove that redirection once we switch to OneDrive. The registry entry (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders) remains redirected as well, from what I remember."

 

Anyone run into this before? How can you disable the redirection, prevent the files copying locally, and have the folders and files no longer redirected?

4 Replies

@Jon Studsrud I am in a similar boat as you.  I see alot of views here but no replies.  Were you able to make an headway on this?

Disable the user configuration in the redirection GPO, rename the redirection folder where the files are and rename the GPO piece to remove folder redirection. That is how I have it and we are fine. @Jon Studsrud 

Hi John, 

 

Can you share any guide / details about how you managed to solve it ? 

 

kind regards 

Syed Mobeen Kazmi 

 

@SSI_IT_MGR 

@Mobeen786 

 

I know this super old, but in our environment, it added multiple registry entries for some of the folders. This is the script I came up with that i'm going to attempt to run as a login script. It looks good in testing so far. Had desktop/documents/picture/favorites/downloads in it

 

# Login Script for Folder Redirection

# Get the current user's profile path
$userProfilePath = [Environment]::GetFolderPath("UserProfile")

# List of folders to check and create
$folders = @('Desktop', 'Documents', 'Pictures', 'Favorites', 'Downloads')

# For each folder, check and create if necessary, then update registry
foreach ($folder in $folders) {
$folderPath = Join-Path -Path $userProfilePath -ChildPath $folder

# Check if folder exists
if (-not (Test-Path -Path $folderPath)) {
# Create the folder
New-Item -Path $folderPath -ItemType Directory -Force
}

# Registry paths for User Shell Folders
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"

# Update the registry to point to the new folder path
switch ($folder) {
'Desktop' { Set-ItemProperty -Path $regPath -Name '{754AC886-DF64-4CBA-86B5-F7FBF4FBCEF5}' -Value '%USERPROFILE%\Desktop' }
'Desktop' { Set-ItemProperty -Path $regPath -Name 'Desktop' -Value '%USERPROFILE%\Desktop' }
'Documents' { Set-ItemProperty -Path $regPath -Name '{F42EE2D3-909F-4907-8871-4C22FC0BF756}' -Value '%USERPROFILE%\Documents' }
'Documents' { Set-ItemProperty -Path $regPath -Name 'Personal' -Value '%USERPROFILE%\Documents' }
'Pictures' { Set-ItemProperty -Path $regPath -Name '{0DDD015D-B06C-45D5-8C4C-F59713854639}' -Value '%USERPROFILE%\Pictures' }
'Pictures' { Set-ItemProperty -Path $regPath -Name 'My Pictures' -Value '%USERPROFILE%\Pictures' }
'Favorites' { Set-ItemProperty -Path $regPath -Name 'Favorites' -Value '%USERPROFILE%\Favorites' }
'Downloads' { Set-ItemProperty -Path $regPath -Name '{374DE290-123F-4565-9164-39C4925E467B}' -Value '%USERPROFILE%\Downloads' }
'Downloads' { Set-ItemProperty -Path $regPath -Name '{7D83EE9B-2244-4E70-B1F5-5393042AF1E4}' -Value '%USERPROFILE%\Downloads' }
}
}