• Uncategorized
  • 0

Migrate homefolders to OneDrive & auto-configure OneDrive with Group Policy

UPDATED POST for migrating homefolders to OneDrive here: https://thoor.tech/2018/07/updated-2018-07-migrate-homefolders-to-onedrive/


More and more companies want to move to the Cloud and take advantage of the Office 365 suite. We know how to migrate mail to Exchange Online but how can we migrate our homefolders to OneDrive?

Microsoft have recently make the SharePoint Migration Tool publicly available to help us do the work.


On the machine that will handle the migration – install the following:

Then create a TXT-file with the UserPrincipalName attribute for the users you want to migrate. Change the Filtering or SearchBase value after your environment.

Then we have a total of three PowerShell scripts what we need to use.

The first script makes a pre-provisioning for each user’s OneDrive. Microsoft does not allocate space for the user until you start OneDrive (via the web or the client installed on the computer), but with the help of the script, administrators can do this.

The second script sets an optional Global Admin as an additional administrator for each user’s OneDrive. If we don’t, we cannot migrate from home directory to the user’s OneDrive using the SharePoint Migration Tool.

The third script retrieves the OneDrive security group and its members, then sets the members’ home directories to “Read” instead of “Full Control” so no changes are made during the migration phase.

Migration Phase

Create a .CSV mapping file containing the path to the user’s home directory and URL to the user’s OneDrive. This is the only thing that needs to be changed. Note that no header should be included in the .CSV-file.

Example of the mapping file:

Script to create the .CSV mapping file.

Double check that the CSV file looks correct!
Try to take one of the user’s OneDrive URL and when logged in with the Global Admin account specified in the second script, try to reach the user’s OneDrive. If this has been done and you can access the URL, then everything is set.

Start the SharePoint Migration Tool and make sure you use the latest version of the tool.

with your Global Admin account for the tenant.
Choose “CSV file for bulk migration”

Locate the file created in the previous script. Then click Add and the tool will check the contents of the file. If there are any errors in the file, the tool will say which row that is wrong.
If everything is correct, you will proceed to the next step.

Click Migrate and wait until migration is complete.
Log in to the Office 365 Admin Center for the tenant and check https://portal.office.com/adminportal/home#/reportsUsage/OneDriveSiteUsage

How to auto-configure the OneDrive client with Group Policy


Copy the ADMX / ADML files for OneDrive from your own computer, make sure you run the latest version of OneDrive for the most compatibility.

Go to the folder that has the latest version in the foldername and then the admin folder.
Copy OneDrive.adml and OneDrive.admx and import them into the Group Policy Central Store. Note that OneDrive.adml should be placed at the en-us folder in the Group Policy Central Store.

GPO settings
Create the following settings in the GPO. When linking the GPO, make sure that both users as computer objects can read the GPO.

Find out the customer’s Tenant ID by running the Azure Active Directory PowerShell module. Type Login-AzureRmAccount and log in. Then you will receive the Tenant ID. Save this GUID for it will be used for GPO settings.

When the user logs in, OneDrive will get their GPO settings and when the user then launches OneDrive it will take 1-2 minutes then OneDrive have auto-configured with the following settings:

  • Log into the OneDrive client with credentials that the user logged in to Windows
  • Auto-enabled by Files On Demand (applies only to Windows 10 1709 – Fall Creators Update)
  • Prevents the user from choosing another location for OneDrive than standard
  • Set default location for OneDrive to %userprofile%

If you need to deploy the OneDrive client to Windows 7 computers with Group Policy you can also do that a few days before the migration so the entire company have the same conditions when you migrate their data.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: