How to add Sharepoint Online and Onedrive for Business as Windows mapped drive

Case

You need to add a Sharepoint Online site or OneDrive for Business files as Windows mapped drive.

Solution

Generally there are three options through which you can add a Sharepoint Online site or OneDrive for Business files as Windows mapped drive.

  1. Option 1. OneDrive for Business client (which comes at cost of storage syncing and Citrix limitations in VDI environments, check Citrix docs for OneDrive limitations).
  2. Option 2. Webdav with required service and IE authentication cached.
  3. Option 3. Via Microsoft Graph API.

Option 1 – Onedrive and Onedrive for Business

OneDrive (retail version) and OneDrive for Business (Office 365 version of work or school accounts) are using the same Microsoft proprietary file syncing protocol. The OneDrive client is available on all Windows operating systems and has also been ported to some other platforms such as MacOSX and Linux. A few more OneDrive implementation solutions for Linux can be found at: https://askubuntu.com/questions/804301/how-to-sync-onedrive-business-office-365-on-linux and by using RClone. Also there is a Microsoft implementation of the OneDrive for Business client for Android and iOS mobile devices.

If you need to troubleshooting OneDrive for Business file sync issues, you should consult the following KB article: https://stefanos.cloud/kb/how-to-troubleshoot-onedrive-for-business-sync-issues/.

Option 2 – WebDAV

The second option is to make use of the WebDAV protocol instead of the natively supported OneDrive for Business client. This is generally not recommended as it lacks the performance, security and credibility levels of OneDrive for Business.

You can try to go down the route of adding a natively supported Windows mapped drive. This however could create performance or stability issues, so use at your own risk. To create a mapped network drive in Windows which connects to a Sharepoint Online site, carry out the steps below.

  • Ensure that the “WebClient” service is up and running on your Windows server or Windows client operating system. If this service is disabled or missing on your server, you will have an error saying “The folder you entered does not appear to be valid. Please choose another”.
  • Click on the Start button of Windows and type in “Internet options” in the search box then click on the relevant icon which appears.
  • On the Internet Properties window, go to the “Security” tab. Click on “Trusted Sites” from the list of zones and click on “Sites”. Then, in the Add this website to the zone box, type in your SharePoint site document library URL. Click on Add and Close.
  • You now need to open Internet Explorer and browse to your Sharepoint Online site document library in order to authenticate at least once with your Sharepoint Online credentials to be cached in the operating system credentials wallet.
  • Now you are ready to open the Windows File Explorer by running command “iexplore.exe”, which will be used to create the mapped drive to the Sharepoint Online site.
  • Right click on the “Computer” icon and then select “Map network drive”.
  • Speficy the desired drive letter, e.g. the Z drive.
  • Enter the folder path which must correspond to the Sharepoint Online site document library you wish to connect to. For example you can use the https://cloudbusinessdirectory.sharepoint.com/sites/testdocs/Documents). Note that in in lower versions of SharePoint the URL cannot include the %20 characters. In this case you need to change the url to include spaces.
  • Tick the “Reconnect at sign-in” and “Connect using different credentials” checkboxes.
  • Click “Finish” to start connecting.
  • You will be prompted to provide your Sharepoint Online credentials.

If you have followed all above steps you should get a successful connection to your Sharepoint Online site document library with a mapped network drive. Otherwise you will receive the following error. In the latter case, you should revisit all above steps and ensure that all of them have been carried out successfully.

There are various third party tools and software applications utilizing the WebDav protocol to connect to both Sharepoint Online and Onedrive for Business. Noteworthy examples of such third party tools are the following:

If you need to add a Windows mapped network drive with different credentials from the ones you are logged on with, you should consult the following KB article: https://stefanos.cloud/kb/how-to-configure-mapped-network-drives-with-different-credentials-using-powershell/.

Option 3 – Microsoft Graph and Azure AD Graph REST APIs

There are various third party tools and software applications utilizing the Microsoft Graph API to connect to both Sharepoint Online and Onedrive for Business. The Graph API is a REST API which can be invoked from any supported software development framework or language, such as .NET, and Powershell. You can use the Microsoft Graph Explorer to authenticate with your Microsoft 365/Azure tenant credentials and run any test API calls you need. The Microsoft Graph API Explorer is available at: https://developer.microsoft.com/en-us/graph/graph-explorer.

Sources

https://docs.microsoft.com/en-us/sharepoint/troubleshoot/administration/troubleshoot-mapped-network-drives?redirectSourcePath=%252fen-us%252farticle%252fhow-to-configure-and-to-troubleshoot-mapped-network-drives-that-connect-to-sharepoint-online-sites-in-office-365-ef399c67-4578-4c3a-adbe-0b489084eabe

Was this article helpful?

Related Articles