GPO: Folder Redirection via OneDrive
14 December 2020If you want to redirect My Documents, Pictures, Favorites, Desktop to OneDrive, this article will guide you through setting up the GPO.
I usually use this method in the following cases:
- Migration of users from one domain to another with data recovery
- Data recovery in the event of a workstation replacement.
- A user with several workstations, who wishes to have access to his data without having a roaming profile.
- Or quite simply as a user data backup solution.
“There are a multitude of solutions that offer you the migration of data from one profile to another, the inconvenience is that copies the profile to a temporary location and then paste it to the destination profile which generally takes a lot of time” on average 2 hours ”which can be extended if the position is old. “
Before starting it will be necessary to look for the ADMX files, unfortunately, Microsoft has not published the download of ADMX files.
- Install OneDrive on a Windows 10
- Navigate to %localappdata%\Microsoft\OneDrive\BuildNumber\adm
- Copy the .ADML and .ADMX files.
- Paste the .ADMX file into the central store for your domain \\domain\sysvol\domain\Policies\PolicyDefinitions “where domain is your domain name”
- Paste the .ADML file into the appropriate language subfolder
- Create a group policy for example OneDrive.
- Create an environment variable called OneDriveSync under User Configuration => Preferences => Windows Settings => Environment .
- General tab: User variable
- Name: OneDriveSync
- Value: %userprofile%\OneDrive – Your Tenant’s Name
- Common Tab – Item Level Targeting
- Type of correspondence: The file exists
- Path: %userprofile%\OneDrive – Your Tenant’s Name
- Go to User Configuration => Administrative Templates => OneDrive
- Turn on Prevent users from changing the location of their OneDrive folder
- Click on display then enter the tenant ID in Value name
- Enter 1 in the Value column
To find your ID in Azure Active Directory:
- Go to Azure Active Directory on the left side
- Select Azure Active Directory.
- Select Properties.
- Find the directory ID
- Go to User Configuration => Administrative Templates => OneDrive
- Turn on Prevent users from syncing personal OneDrive accounts
- Go to User Configuration => Windows Settings => Folder Redirection
- Edit each folder you want to redirect with the following:
- Target tab – Settings: Basic
- Target folder location: redirect to the following location
- Root path: %Onedrivesync%\Documents
Settings tab If you want everything to move automatically, select Move folder contents to new location
Views: 42070