OneDrive – Redirect Folders

email me

Manual Testing


* Using the Desktop folder as an example…

1. Make sure OneDrive is installed, and that this path is accessible: %USERPROFILE%\OneDrive.

2. Log into user’s online live or outlook account, and open the Files > Desktop folder in the web console.

3. In Windows Explorer, Navigate to C: > Users > username > select Properties of Desktop folder > select Location tab > set Location: %USERPROFILE%\OneDrive\Desktop > click Move button.

4. Verify user files and folders exist at %USERPROFILE%\Desktop and in the web console, onedrive.live.com > Files > Desktop.

5. Verify you can reach the user’s desktop by clicking Desktop under Quick Access, and Desktop under This PC in the Navigation pane.

 

Enterprise Setup


* Using the Desktop folder as an example…

1. Install OneDrive client on enterprise computers.

2. Create a GPO to redirect the Desktop folder from %USERPROFILE%\Desktop to %USERPROFILE%\OneDrive\Desktop.

3. When the user logs in for the first time on a new computer, they will authenticate to OneDrive.

4. Desktop files and folders will become accessible via the normal folder names, such as Desktop, and by the normal folder paths, such as %USERPROFILE%\Desktop. Shortcuts to the Desktop in Quick Access, the Navigation pane, and in other applications will not be impacted by the change.

 

Automated Redirect Solution


* Using the Desktop folder as an example…

Move Data

robocopy /MOVE /E /PURGE “%USERPROFILE%\Desktop” “%USERPROFILE%\OneDrive\Desktop”


Make Link

mklink /D %USERPROFILE%\Desktop %USERPROFILE%\OneDrive\Desktop


Update User Shell Folder

reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v Desktop /t REG_EXPAND_SZ /d ^%USERPROFILE^%”\OneDrive\Desktop” /f

reg add “HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders” /v Desktop /t REG_EXPAND_SZ /d ^%USERPROFILE^%”\OneDrive\Desktop” /f


Last Step

reboot, or reload explorer.exe

 

Notes

 
OneDrive Guide for Enterprises

Deploy OneDrive apps by using System Center Configuration Manager

Deploy OneDrive apps by using Intune

Network utilization planning for the OneDrive sync app

Redirect and move Windows known folders to OneDrive

Deploy and configure the new OneDrive sync app for Mac

Use Group Policy to control OneDrive sync client settings

 

Registry 

User Shell Folder Reg Keys (notice how some have GUIDs)

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

 

tags: Folder redirects, OneDrive scripting, OneDrive folders, MrNetTek