Using OneDrive, Folder Rediection, and Group Policy Objects
The Goal
- Use OneDrive for Business for:
- Documents
- Pictures
- Movies
- Music
- Desktop
- Make it transparent to the end user
- Use GPO for easy deployment
This requires OneDrive for Business to be setup the to the same folder in %USERPROFILE% for each user for this example it will be %USERPROFILE%\One Drive for Business
The Issue
When setting the Folder Redirection setting in GPO, if target folder started with %USERPROFILE% GPO assumes it is the default location. e.g. Documents = %USERPROFILE%\Documents.
The Solution
First: Create a GPO that sets an user environment variable, this GPO must be processed BEFORE the next one.
ONEDRIVE = %USERPROFILE%\OneDrive for Business
this in User Configuration\Preferences\Windows Settings\Environment
Second: Create a GPO to set the Folder Redirection policy.
Documents = %ONEDRIVE%\Documents
this is in User Configuration\Windows Settings\Folder Redirection
Third:
Run
gpupdate /force
on each computer and reboot or at lest log out and back in.
The Result
If the users Redirected Folders where not in the OneDrive location they were moved when they first logged in and OneDrive synced them.