OneDriveMapper is a free, open source script I wrote to be used as a logon or on demand script to map OneDrive for Business and/or Sharepoint Online to driveletters and/or Network Locations, it has been downloaded over 2,500,000 times and has millions of users.
It was designed to run in scenario’s where using the Onedrive for Business client is not feasible, such as legacy multi-user environments like Citrix or within a RemoteApp. Syncing in such environments is a bad idea as each user potentially has to re-sync data at each login and can potentially access other user’s data.
Download open source version:
OnedriveMapper V3 / older releases (does not support all types of MFA, conditional access etc but has more features. Still seems to work on all OS’es)
OnedriveMapper v4 (very lightweight and simple version that supports all kinds of MFA but depends on Internet Explorer)
OnedriveMapper v5 beta 1 (next iteration of v4 but using Edge instead of Explorer, but does not work on older OS’es like W2008/2012)
Enterprise alternative (with support & discount):
How to install (instruction for V5)
- Make sure Edge Chromium is installed
- Make sure .NET 3.5 and PowerShell v3 or higher are present on the Machine
- Download the latest version at GitLab to a network share or your devices
- Download the Selenium Webdriver.dll from NuGet or GitLab to the same folder as OnedriveMapper.ps1
- Download the Edge msedgedriver.exe from NuGet or GitLab to the same folder as OnedriveMapper.ps1
- Add https://tenantname-my.sharepoint.com to your Trusted Sites list if mapping to O4B
- Add https://tenantname.sharepoint.com to your Trusted Sites list if mapping to Sharepoint Sites, O365 Groups or Microsoft Teams
- Add adfs.yourdomain.com to your local intranet sites (both http and https) to get SSO if you’re using ADFS. Make sure that whatever method you use to set this, runs BEFORE the script runs.
- Set $O365CustomerName to your Tenant Name (xxx.onmicrosoft.com) in the script’s source code
- disable file locking
- Run it on a representative test machine / user and thoroughly check the log it generates in %APPDATA%
- Add the configured script to a Group Policy or deploy as MSI to make it run upon logon for all users, automatically mapping your OneDrive for Business webdav share to a driveletter.
When do I use OnedriveMapper?
In short: only when you have no other choice!
With Files On Demand and GPO support for passthrough auth and automatic mapping of sharepoint and teams sites, the need for OnedriveMapper has been greatly reduced. When you’re thinking of adopting VDI, go Azure Virtual Desktop with FSLogix instead of OnedriveMapper.
Please try to make the effort to educate your users, don’t swim against the current; start embracing new cloud technologies.
If you really have no other option, e.g. you have automated processes you cannot yet rewrite to use the Onedrive API, or are working in a W7/W2012 multi user environment and can’t just use the web interface. Do make sure your systems do not fully depend on mapping drives as they could break at any time, WebDAV is not a very….’recent’ technology and Microsoft does not give any hard guarantees as till when it will be supported.
So what does OnedriveMapper do?
- Runs at logon or on demand (group policy, RES, etc)
- Maps to Onedrive for Business (with auto detection of the user’s URL)
- Maps to Office 365 Groups and Teams
- Maps to Sharepoint Online
- No Sync, online WebDav connection over HTTPS
- No user interaction if SSO is enabled
- On Demand Provisioning of the OneDrive MySite
- Detailed and configurable logging
- Map based on AD security groups
- Custom labeling of drives
- Can also run on non domain joined machines or Workplace Joined machines
- Detects changed user names/url’s automatically
- Can map drives inside (Azure) RemoteApps or Citrix Seamless Apps
- Can redirect OS folders (like My Documents)
- Can converge multiple mappings in a single driveletter
- SSO for MDM Intune AzureAD W10 devices
- Can be deployed as logon script through Intune
- Can easily run from a shortcut as well
- Exclude any mappings from scheduled virus scans
- Do not let windows search index mapped locations
- Disabled WebDav (WebClient) File Locking
- Migrate user homedirectories to O365 automatically first
- Remove the WebDav cache if it becomes too large
- Try not to have spaces in sharepoint library names
- If SSO is not configured or MFA is required, the script will show the user a popup to authenticate
- This script does not work Powershell V2 or lower (comes with Windows 7), install V3 or higher
- This script does not operate on Windows 2012 R2 (or lower) as the Selenium webdriver component does not support this.
I’m not a real programmer, this code is meant as an example. I do not guarantee this product will work in your setup, and I offer no dedicated support, I try to help everyone on a best-effort basis but also have to work for a living. So make sure you test well before you use it. This script may suddenly become obsolete without prior warning if Microsoft feels that WebDAV should no longer be supported. For an enterprise worthy and supported product, I recommend using IAM Cloud Drive Mapper instead of an open source script. If you use LIEBEN25 as referral code with IAM Cloud, you’ll get a 25% discount.