Redirect known folders to OneDrive for Business

Redirect known folders to OneDrive for Business

This article is for IT admins managing the OneDrive sync client in a Windows Server enterprise environment that uses Active Directory Domain Services. You can redirect Windows known folders (such as Documents) to the OneDrive for Business sync location for the users in your domain.

There are two primary advantages to doing this:

  • Your users can continue using their Documents and other similar folders. They don’t have to change their daily work habits to use OneDrive.
  • Using OneDrive for your documents gives you a backup of your data in the cloud and gives you access to your documents from any device.

For these reasons, we recommend setting up folder redirection if you’re an enterprise or large organization. Small or medium businesses may also find this useful, but keep in mind you’ll need some experience with Group Policy and data migration to follow the procedures below.

How it works

Here’s an overview of what we’ll be configuring in this article:

  1. We’ll set a policy at the domain level to make sure users all sync to the same folder when they install the OneDrive sync client.
  2. We’ll set additional policies to redirect the Documents folder to that sync location.

When users sign in on their computers, Group Policy will detect if the OneDrive folder exists in the specified location. If the folder doesn’t exist (for example, if the user hasn’t set up the sync client yet or if this is the first time they’ve signed in on the computer), the Documents folder will not be redirected. If the folder does exist, the Documents folder will be redirected to the OneDrive folder.

Once the Documents folder has been redirected, shortcuts to Documents – such as those in File Explorer – will point to the new location. However, the original folder and its contents will remain at its previous location under %userprofile%\Documents. You can then migrate any files from the original folder to OneDrive, and delete the original folder if desired.

Before you begin

There are a number of things to consider in determining if redirecting known folders to OneDrive is a good solution for your organization:

  • OneDrive has some restrictions around file naming, file size, and file type, that you should review before deploying new OneDrive sync client. Keep in mind that your users may try to use files of these types with OneDrive, or the OneDrive sync client may try to sync them when you redirect users’ Documents folders.
  • If your users have used the Documents folder as an installation location for some legacy applications, the applications may no longer work after the folder has been redirected. If your organization uses legacy applications that were not written to support folder redirection, be sure to test them before redirecting folders to OneDrive.
  • If your users’ Documents folders contain items with a very high frequency of updates – such as databases, web servers, or Outlook OST files – we recommend not redirecting these folders to OneDrive. While such files should continue to function normally, the high frequency of sync activity due to constantly changing files may cause network and performance issues.

If you’re already redirecting known folders to a different location – for example, a network share – or if you have already deployed the new OneDrive sync client, then there are some additional planning considerations:

  • If known folders are currently redirected to a network share or other location, you will need to migrate the data from that location to OneDrive after you redirect the known folders to OneDrive.
  • After you redirect known folders to OneDrive using the procedures in this article, existing files in known folders will remain on users’ computers and need to be manually moved to each user’s OneDrive folder. We suggest using XCopy or Robocopy scripting as an automated way of moving the files for your users.
  • To redirect known folders to OneDrive, users must be syncing their OneDrive files to the default location (%userprofile%\OneDrive – <TenantName>). Known folders can’t be redirected to a different location.
  • If your users have a large amount of data that will be uploaded to OneDrive, you may want to stage your deployment to limit the impact on your network.

Prerequisites and baseline environment

The procedures in this article require a particular existing configuration to exist in order to work. Check these prerequisites before you get started:

  • Make sure you installed the OneDrive for Business Group Policy objects on your domain, and updated the ADMX file with your tenant ID.
  • Make sure any existing OneDrive users in your organization are syncing their files to the default sync location (%userprofile%\OneDrive – <TenantName>). Users who are syncing files to a different location will not have their known folders redirected to OneDrive.
  • All of the procedures in this article are performed in your domain Group Policy editor. You need to be a domain administrator to perform these procedures.

Redirecting known folders to OneDrive

The first step in redirecting known folders to OneDrive is to make sure users sync their OneDrive to the default location when they set up the sync client. We do this through a domain policy.

To prevent users from changing the location of their OneDrive folder

  1. In your domain Group Policy editor, under User Configuration\Policies\Administrative Templates\OneDrive, double-click Prevent users from changing the location of their OneDrive folder.
  2. Select the Enabled option, and then click OK.

The next step is to create an environment variable for the OneDrive folder. Group Policy won’t let us redirect known folders directly to a different location under %userprofile%, so we need to create a new environment variable that contains the location of the folder under %userprofile%.

We’ll use item-level targeting in this environment variable to prevent folders from being redirected until the folder has been created by the sync client.

To create an environment variable for the OneDrive folder

  1. In your domain Group Policy editor, under User Configuration\Preferences\Windows Settings, right-click Environment, click New, and then click Environment Variable.
  2. In the Name box, type OneDriveSync.
  3. In the Value box, type %userprofile%\<SyncFolder>.

    <SyncFolder> is the name of your default folder. For example, OneDrive – Contoso   .

  4. On the Common tab, select the Item-level targeting check box, and then click Targeting.
  5. In the Targeting Editor, click New Item, and then click File Match.
  6. Choose Folder exists from the Match type drop down list.
  7. In the Path box, type %userprofile%\<SyncFolder> (the same path that you used in step 3).
  8. Click OK.
  9. Click OK.

Now it’s time to configure the known folders redirection itself.

Note that we do not support having existing content automatically migrated by Group Policy to the OneDrive folder. (See the warning in the procedure below). With automatic file migration, there is a potential for data loss in cases where there are files in both locations that have matching file names.

To redirect Documents folders to OneDrive

  1. In your domain Group Policy editor, under User Configuration\Policies\Windows Settings\Folder Redirection, right-click Documents and click Properties.
  2. From the Settings drop down list, choose Basic – Redirect everyone’s folder to the same location.
  3. Under Target folder location, choose Redirect to the following location.
  4. In the Root Path box, type %OneDriveSync%\Documents.
  5. On the Settings tab, clear the Move the contents of Documents to the new location check box.

    WARNING: Leaving this setting enabled could result in data loss when the contents of the Documents folder is merged with the OneDrive folder, if there are files with the same name in both locations.

  6. Click OK.

We’ve now set the Documents folder to redirect to the OneDrive folder. You can also easily redirect related known folders – Picture, Music, or Videos – by having them follow the redirection of the Documents folder. If you want to do this, use the following procedure.

To redirect related folders to the OneDrive folder

  1. In your domain Group Policy editor, under User Configuration\Policies\Windows Settings\Folder Redirection, right-click the related folder that you want to redirect – Pictures, Music, or Videos – and click Properties.
  2. In the Setting drop down list, choose Follow the Documents folder.
  3. Click OK.

Now that folder redirect has been configured, users’ known folders will be redirected to their OneDrive folder once their OneDrive sync client has been set up. Once the redirect is in place, you’ll need to migrate the user’s data from the original location on their local disk to the OneDrive folder.

Keep in mind that as new users and computers come online over time, users may still save files to their Documents folder before they configure the OneDrive sync client, and these files would then need to be moved to the OneDrive folder after the redirect takes place.

See Also

How to See Which Group Policies Are Applied to Your PC and User Account

How to See Which Group Policies Are Applied to Your PC and User Account

How to See Which Group Policies Are Applied to Your PC and User Account

By Walter Glenn on May 31st, 2017

We have shown you a lot of tips and tricks over the years that involve modifying Local Group Policy. If you would ever like to see all the Group Policy settings in effect on your PC, here’s how to do it.

In the Windows world, Group Policy provides a way for network administrators to assign specific settings to groups of users or computers. Those settings then get applied whenever a user in the group logs in to a networked PC or whenever a PC in the group is started. Local Group Policy is a slightly more limited version that applies settings only to a local computer or users—or even a group of local users. We’ve featured a number of tricks here in the past that use Local Group Policy to change settings that you can’t change anywhere else—except by editing the Windows Registry. If you’re in the habit of changing Local Group Policy settings, you might find it useful to see all the changes you’ve made in one place, rather than digging through the Local Group Policy Editor.


Note: Local Group Policy is only available in the Professional and Enterprise versions of Windows. If you’re using a Home edition, you won’t have access to the Local Group Policy Editor.

View Applied Policies with the Resultant Set of Policy Tool

The easiest way to see all the Group Policy settings you’ve applied to your PC or user account is by using the Resultant Set of Policy tool. It doesn’t show every last policy applied to your PC—for that you’ll need to use the Command Prompt, as we describe in the next section. However, it does show pretty much all the policies you will have set for regular use. And it provides a simple, graphical interface for browsing through the Group Policy settings currently in effect on your PC—whether those settings come from Group Policy or Local Group Policy.

To open the tool, hit Start, type “rsop.msc,” and then click the resulting entry.

The Resultant Set of Policy tool starts by scanning your system for applied Group Policy settings.

After it’s done scanning, the tool shows you a management console that looks very much like the Local Group Policy Editor—except that it only displays enabled settings along with a few unconfigured security settings.

This makes it easy to browse through and see what policies are in effect. Note that you can’t use the Resultant Set of Policy tool to change any of these settings. You can double-click a setting to view details, but if you want to disable or make changes to a setting, you’ll have to use the Local Group Policy Editor.

View Applied Policies with the Command Prompt

If you’re comfortable using the Command Prompt, it does provide a couple of advantages over using the Resultant Set of Policy tool. First, it can show every last policy in effect on your PC. Second, it will show some additional security information—like what security groups a user is part of or what privileges they have.

To do this, we’ll be using the gpresult command. You must specify a scope for the results, and valid scopes include “user” and “computer.” This means that to see all the policies in effect for the user and the PC, you’ll have to run the command twice.

To view all the policies applied to the user account you’re currently logged in with, you would use the following command:

The /v parameter in that command specifies verbose results, so you’ll see everything. Scroll down a bit and you’ll see a section named “Resultant Set Of Policies for User,” which contains the information you’re after.

If you’re looking for all policies applied to your Computer, all you need to do is change the scope:

If you scroll down, you’ll see that there is now a Resultant Set Of Policies for Computer section.


A origem da bruxaria

A bruxaria é um tema que atiça a curiosidade de muita gente. A reintegração do ser humano à natureza é parte fundamental das crenças pagãs. Nesse episódio acompanhe as investigadoras Juliana Ponzilacqua, Tupá Guerra, Ira Croft, Lívia Penumbra e Andrei Fernandes desvendando a origem oculta da prática da bruxaria antiga nessa primeira parte.  Download do episódio […]

O post Mundo Freak Confidencial 142 – A Origem da bruxaria – Parte 1 apareceu primeiro em Mundo Freak.