Using the WebDAV Redirector with OneDrive Part 1 – Standard Security


If you have read some of my previous blog posts and IIS.NET articles about WebDAV, you will see that I often use the WebDAV Redirector that is built-in to Windows in order to connect to various WebDAV websites. This allows me to access my files via a mapped drive letter, which also enables me to use WebDAV with applications that do not have native WebDAV support. (Like Visual Studio.) I'm also a big fan of OneDrive, but sometimes I'm on a legacy system where I don't have OneDrive installed. With that in mind, I thought that I would put together a quick blog series to show you how to map a drive letter to your OneDrive files.

In Part 1 of this series, I will show you how to map a drive letter to your OneDrive account by using standard security. In Part 2 of this series, I will show you how to map a drive letter to your OneDrive account after you have enabled two-step verification for your account security.

Step 1 - Log Into Your OneDrive Account

The first thing that you need to do is to browse to https://onedrive.live.com/ and sign in with your Windows account.

Step 2 - Determine Your OneDrive Customer ID

Once you have logged in to your OneDrive account, hover your mouse over the Files link on the left part of your browser window – this will show your customer number in the status bar on the bottom of your browser window. If you have the status bar disabled, you can right-click the Files link and click Copy Shortcut in the pop-up menu. (Note: Those instructions are for Internet Explorer, but the method should be similar in Chrome or Firefox.)

Your Customer ID is the value that is specified after the "cid=" in the URL; for example: "https://onedrive.live.com/?cid=426f62526f636b73". You will need this value when you map a drive letter.

Step 3 - Map the Drive Letter

Your next step is to map the drive letter, and there are a few ways to do this. I have documented several methods in my Using the WebDAV Redirector article on the IIS.net website, but I will show a few ways in this blog.

Method #1 - Using the Windows User Interface and Wizards

On most of my systems I have the Network and This PC or My Computer icons on my desktop, which makes it easy to simply right-click one of those icons and select Map network drive:

An alternate method on Windows 8 is to open This PC and Map network drive will be listed as an icon on the Windows Explorer ribbon:

Once the Map Network Drive Wizard appears, enter "https://d.docs.live.net/" followed by your Customer ID from Step 2. For example: "https://d.docs.live.net/426f62526f636b73/"

When the Windows Security dialog box appears, enter the email address and password that you used to log into your OneDrive account in Step 1.

Once the mapping has been completed, you will be able to view your OneDrive files in Windows Explorer via the mapped drive:

Method #2 - Using the Windows Command Line

You can also map a WebDAV drive letter to your OneDrive account from a command line. The general syntax is listed below:

 
C:\>net use * https://d.docs.live.net/xxxxxxxxxxxxxxxx/ /user:"user@example.com" "password"

 

For example:

C:\>net use * https://d.docs.live.net/426f62526f636b73/ /user:"bob@contoso.com" "P@ssw0rd"

C:\>dir
 Volume in drive Z has no label.
 Volume Serial Number is 0000-0000

 Directory of Z:\

09/02/2014 10:38 PM <DIR> Applications
09/27/2014 08:43 AM <DIR> Blog Photos
09/29/2014 10:50 PM <DIR> Documents
08/17/2014 03:44 AM <DIR> Pictures
09/22/2014 05:58 PM <DIR> Public
09/29/2014 10:43 AM <DIR> SkyDrive camera roll

C:\>

That wraps it up for Part 1 of this blog series. In Part 2, I will show how to map a WebDAV drive to your OneDrive account after you have enabled two-step verification for your account security.

Comments (8)

  1. Tim says:

    Hey thanks a lot, works like a charm! 😉

  2. Sean says:

    OMG. Thanks, works really well.

  3. Antonio says:

    Is it possible to do the same simple process with Google Drive, i.e. without using its own app?

    Thanks,

  4. robmcm says:

    @Antonio – I do not know if Google Drive natively supports WebDAV connectivity, which would be required for mapping a drive letter natively in Windows. But that being said, two products named NetDrive and WebDrive will add functionality to Windows which will allow you to map a drive letter to Google Drive, DropBox, FTP, Amazon S3, etc. With that in mind, I wrote the following two blogs which discuss using those products with FTP sites a couple of months ago, and you might find them useful:

    blogs.msdn.com/…/ftp-clients-part-15-webdrive.aspx

    blogs.msdn.com/…/ftp-clients-part-16-netdrive.aspx

    Thanks!

  5. Robert says:

    There appears to be a problem with this.  Using this approach I can consistently copy a small (~ 5 MB) file to the OneDrive location but for larger files they persistently fail (e.g. ~165 MB, ~1 GB).  My intended use of OneDrive is to push existing backup archives to it, but I am unable to do so.  

    Is this is a limitation of the WebDav implementation or of OneDrive itself?  I do not want to use the OneDrive client nor to have to install Windows Live Essentials.  Aside from which, the OneDrive client appears to give an pretty limited set of folder options to synchronise.

    A truely global storage solution should support http, ftp, nfs, smb, etc.

  6. robmcm says:

    The WebDAV Redirector has a default max file size of 50MB, but that can be changed; see the "WebDAV Redirector Registry Settings" section of the following article:

    http://www.iis.net/…/using-the-webdav-redirector

    That being said, you should be able to copy files up to 10GB to OneDrive; see the following for more:

    blog.onedrive.com/onedrive-now-supports-10-gb-files

    Thanks!

  7. Frank says:

    How can you find the Customer ID for the business version of OneDrive, the screenshot shows the consumer version.  I am having trouble mapping a drive and keep getting access denied messages when using the @sslDavWWWRoot method of connecting.  Any ideas?

    Thanks!

  8. ivath0 says:

    I have been looking for a way of syncing my Thunderbird calendars between my Win 10 PC and my Androids and Onedrive seems an ideal hub for this sync.

    I mapped a drive for OneDrive and created a new calendar in Thunderbird but the calendar does not exist in OneDrive.

    Can you provide me with more guidance?

    Thanks

Skip to main content