Undo powershell script onedrive folder redirect
When we set up Intune 3-4 years ago, we used a OneDrive known folder redirection PowerShell script because Intune did not have this setting natively at the time.
Now, I would like to transition to the native OneDrive configuration: Silently move Windows known folders to OneDrive.
is there a way to undo this script and work with the native version.
You could write another script that deletes the scheduled task that's running the PowerShell redirection script - Folder Redirection.
The Settings Catalog to enable Known Folder Move for OneDrive should be able to be applied at the same time as the script is running. So you could apply the Settings Catalog and deploy a script to delete the scheduled task at the same time.
Hi,
Thank you for your message.
However, when I disable the scheduled task and add a user to the default "Move Known Folders" policy, the user ends up with duplicate Documents, Desktop, and Pictures folders in their home directory. Additionally, the original folder with its content is no longer synced, and a new empty folder becomes the primary sync location.
Could you advise on how to resolve this issue?
Check the paths from the command line or from the right-click Copy as path option and see what the actual underlying paths are. You might need to write a script that can move files from the old paths to the new.
Otherwise, scope the Known folder move policy to machines where the original script has not been applied and leave the script assigned to the existing machines. Then cycle out the old machines through natural attrition (replacement, reset/redeploy etc.)