OneDriveMapper is a free, open source script I wrote which you can use 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 500,000 times, has millions of users and is also listed on Technet.
It was designed to run in scenario’s where using the Onedrive for Business client is not feasible, such as 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)
OnedriveMapper v4 latest (very lightweight and simple version that supports all kinds of MFA)
Enterprise alternative (with support & discount):
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.
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 forgiving technology.
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
- Office 365 licence
- Permission to map drives
- Permission to launch powershell scripts
- Internet Explorer
- 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
How to install
- Download the latest version at GitLab
- 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.
- Ensure Windows Authentication is enabled in Internet Explorer (this is default)
- Set $O365CustomerName to your Tenant Name (xxx.onmicrosoft.com)
- 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.
- 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
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.