Thursday, August 18, 2016

Map Network Drive to SharePoint Online O365

Map a Network Drive to SharePoint Online (O365)


The trick is to:
  1. Copy the URL of the Document Library to the clipboard
  2. Open Windows Explorer
  3. Right-click "Network" and click "Map Network Drive" to display the dialog "Map Network Drive" 
  4. In the dialog click "Connect to a Web site that you can use to store your documents and pictures" to display the dialog "Add Network Location"
  5. In the dialog click "Next" and then "Next" again to display a new dialog
  6. In the textbox "Internet or network address" paste the copied URL of the Document Library
  7. Delete the "https:" part of the URL
  8. Replace every forward slash with a backward slash
  9. Insert "@ssl" after ".com"
  10. Finish the dialogs
In my example the URL is "https://awesomesauce.sharepoint.com/Document%20Library" and should hence be "\\awesomesauce.sharepoint.com@ssl\Document%20Library" after the above changes.
You should now be able to access the Document Library from your Windows Explorer.
  1. Open the document library in SharePoint Online
  2. Copy the URL of the document library to the Clipboard (e.g https://awesomesauce.sharepoint.com/Docs/Forms/AllItems.aspx)
  3. Open a new Word document
  4. Click Save As to open the Save As dialog
  5. Paste the URL from the clipboard into the Address text box at the top of the Save As dialog
  6. Delete /Forms/AllItems.aspx from the URL in the text box
  7. Press Enter to open the document library
  8. Right-click Favorites (top left of the Save As dialog)
  9. Click Add current location to Favorites
  10. Rename the new shortcut (optional)
Add to Favorites 
SharePoint Online in Office 365 uses forms based authentication and the user is authenticated using a SAML token. This SAML token expires every 2 hours (some say longer though). After that the mapped drive for the SharePoint library cant access the library unless the user signs in to the SharePoint Online site again from the browser, even if the user tick off "Keep me signed in". As an alternative you can add the URL of the document library to Favorites in Windows Explorer. You'll need to do that via e.g. Word.
Now to ensure you do not lose connectivity to the library after your SAML authentication token expires:
  1. Open the document library in SharePoint Online
  2. Copy URL to clipboard ex: (https://awesomesauce.sharepoint.com/Docs/Forms/AllItems.aspx))
  3. Open a new Word document
  4. Click Save As to open the Save As dialog
  5. Paste the URL from the clipboard into the Address text box at the top of the Save As dialog
  6. Delete /Forms/AllItems.aspx from the URL in the text box
  7. Press Enter to open the document library
  8. Right-click Favorites (top left of the Save As dialog)
  9. Click Add current location to Favorites
  10. Rename the new shortcut (optional)