Freigeben über


Using the WebDAV Redirector with OneDrive Part 2 - Two-Step Verification

This blog is Part 2 of a series about mapping a drive letter to your OneDrive account. In Part 1 of this series, I showed you how to map a drive letter to your OneDrive account when you are using standard security, and in this blog 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. The process is largely similar, with the notable exception that you need to generate an application password which you will use when you are mapping the drive letter with the WebDAV Redirector.

A quick note about two-step verification: enabling this security feature adds an additional requirement so that you will need to use a secondary method to verify your identity when you are logging in. (For example, you can use a phone app, text message, or second email account.) However, you cannot use a secondary login method when you are using the WebDAV Redirector, so you will need to create an application password. (Note: More information about two-step verification for your Microsoft is available in the Two-step verification: FAQ .)

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 - Generate an Application Password

To map a WebDAV drive to your OneDrive account after you have enabled two-step account verification, you will need to generate an application password which you will use when you enter your credentials. (Note: More information about two-step verification can be found in the App passwords and two-step verification article.)

To generate an application password, you first need to log into your Microsoft account settings at https://account.live.com/:

Once you have logged in, click on Security & password and then Create a new app password:

When the app password page is displayed, copy the password for later:

Step 4 - 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 your email address that you used to log into your OneDrive account in Step 1 and the application password that you created in Step 3.

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" "426f62526f636b73"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> Applications09/27/2014 08:43 AM <DIR> Blog Photos09/29/2014 10:50 PM <DIR> Documents08/17/2014 03:44 AM <DIR> Pictures09/22/2014 05:58 PM <DIR> Public09/29/2014 10:43 AM <DIR> SkyDrive camera rollC:\> 

That wraps it up for Part 2 of this blog series - I hope this helps!

Comments

  • Anonymous
    January 04, 2015
    Hi, I did exactly what you wrote, and can see the mapped drive, but it comes up empty. Also I cannot add a folder or test file in there, so somehow it's not allowing me to access the data or have permissions to read/write additional files.