2

At our company we have a SharePoint 2013 installation. Before when I was still running Office 2013 I could install the OneDrive for Business client which allowed me to sync my SharePoint Documents to my local PC. I recently upgraded to Office 2016 and the installation of OneDrive for Business was deleted and replace with the "new" one drive. The new OneDrive allows sync with OneDrive for business but I can't find a way to sync with a SharePoint.

Does anyone know how to sync a SharePoint with a PC that runs Office 2016?

Dider Kerckhof
  • 51
  • 1
  • 2
  • 4

1 Answers1

4

This question is more than a year old, but I just ran into the same problem, and found a workaround.

The specific issue I was facing was attempting to synchronize an Office 365 SharePoint shared document folder with the OneDrive client installed on my PC. When clicking the "Sync" button on a shared folder online, the browser would attempt to open the OneDrive for Business client. Clicking "Open OneDrive for Business" would launch the application and start synchronizing. After a minute or two, the client would then return "This library can no longer be synced using this application. To sync these files, use the latest OneDrive application."

Unsuccessful steps taken to solve the problem:

  • Uninstalling the newer OneDrive client
  • Removing the Office account and reauthenticating
  • Forcing OneDrive.exe (the new client) to open the "Sync" link
  • Copying the URL to the SharePoint folder, and manually adding it as a library to the OneDrive for Business Client

After some research and debugging, it seems that Microsoft has not yet updated SharePoint for Office 365 to use the newer protocol for the "next generation" OneDrive client. OneDrive for Business, formerly known as Groove, uses the Groove Open protocol (grvopen://) to interact with browser content. The new OneDrive client uses a different OneDrive Open protocol (odopen://).

A Groove Open link would look like this (line breaks added at & for readability):

grvopen://<url-encoded-path-to-library-here-including-https://>/{<SharePoint-list-id>}/<list-base-type>?OPENLIST&
siteId=<site-id>&
webId=<web-id>&
webTitle=<web-title>&
listId=<list-id-surrounded-by-braces>&
listTitle=<list-title>&
userEmail=<user-email>&
listTemplateTypeId=<list-base-template-id>&
webUrl=<url-encoded-absolute-path-to-folder>&
webLogoUrl=<relative-url-to-logo>&
webTemplate=<web-template>&
isSiteAdmin=<is-site-admin>

An example looks like this:

grvopen://https_58_47_47www_46sharepoint_46com_47Documents/_aahl00000000_450000_450000_450000_45000000000000%7D/101?OPENLIST&siteId=00000000-0000-0000-0000-000000000000&webId=00000000-0000-0000-0000-000000000000&webTitle=SharePoint%20Site%20Title&listId={00000000-0000-0000-0000-000000000000}&listTitle=Documents&userEmail=user@domain.com&listTemplateTypeId=101&webUrl=https%3A%2F%2Fwww.sharepoint.com%2FDocuments&webLogoUrl=_layouts%2F15%2Fimages%2Fsiteicon.png&webTemplate=1&isSiteAdmin=0

I'm not sure what kind of encoding results in the underscores with the URL, but it's irrelevant to the solution.

I was able to get my personal OneDrive directory in Office 365 to synchronize with the correct OneDrive client on my PC, so I used Chrome's Dev Tools to monitor network traffic when clicking "Sync". The traffic revealed the following URL format for the new OneDrive client (adding line breaks for readability):

odopen://sync?
siteId=<site-id>&
webId=<web-id>&
webTitle=<web-title>&
listId=<list-id-surrounded-by-braces>&
listTitle=<list-title>&
userEmail=<user-email>&
listTemplateTypeId=<list-base-template-id>&
webUrl=<url-encoded-absolute-path-to-folder>&
webLogoUrl=<relative-url-to-logo>&
webTemplate=<web-template>&
isSiteAdmin=<site-admin>&
scope=OPENLIST

And a sample URL:

odopen://sync?siteId=%7B00000000-0000-0000-0000-000000000000%7D&webId=%7B00000000-0000-0000-0000-000000000000%7D&webTitle=SharePoint%20Site%20Title&listId=%7B00000000-0000-0000-0000-000000000000%7D&listTitle=Documents&userEmail=email%40domain.com&listTemplateTypeId=101&webUrl=https%3A%2F%2Fwww.sharepoint.com%2FDocuments&webLogoUrl=_layouts%2F15%2Fimages%2Fsiteicon.png&webTemplate=1&isSiteAdmin=0&scope=OPENLIST

Not so different from the Groove links. To craft a correctly formatted OneDrive URL, I wrote a JavaScript bookmarklet to extract the necessary parameters from the global JavaScript variable _spPageContextInfo available in the DOM of a SharePoint site.

You may have noticed that the parameters containing Guids above are wrapped in curly braces. The Guids extracted from _spPageContextInfo are already wrapped in curly braces.

(function() {
    var siteId = _spPageContextInfo.siteId
      , webId = _spPageContextInfo.webId
      , webTitle = _spPageContextInfo.webTitle
      , listId = _spPageContextInfo.listId
      , listTitle = _spPageContextInfo.listTitle
      , userEmail = _spPageContextInfo.userEmail
      , listTemplateTypeId = _spPageContextInfo.listBaseTemplate
      , webUrl = _spPageContextInfo.webAbsoluteUrl
      , webLogoUrl = _spPageContextInfo.webLogoUrl
      , webTemplate = _spPageContextInfo.webTemplate
      , isSiteAdmin = (_spPageContextInfo.isSiteAdmin ? 1 : 0)
      , scope = "OPENLIST";

    var oneDriveURL = "odopen://sync?";
    oneDriveURL += "siteId="+encodeURIComponent(siteId);
    oneDriveURL += "&webId="+encodeURIComponent(webId);
    oneDriveURL += "&webTitle="+encodeURIComponent(webTitle);
    oneDriveURL += "&listId="+encodeURIComponent(listId);
    oneDriveURL += "&listTitle="+encodeURIComponent(listTitle);
    oneDriveURL += "&userEmail="+encodeURIComponent(userEmail);
    oneDriveURL += "&listTemplateTypeId="+encodeURIComponent(listTemplateTypeId);
    oneDriveURL += "&webUrl="+encodeURIComponent(webUrl);
    oneDriveURL += "&webLogoUrl="+encodeURIComponent(webLogoUrl);
    oneDriveURL += "&webTemplate="+encodeURIComponent(webTemplate);
    oneDriveURL += "&isSiteAdmin="+encodeURIComponent(isSiteAdmin);
    oneDriveURL += "&scope="+encodeURIComponent(scope);

    window.location.href = oneDriveURL;
}());

To use the above code, create a new bookmark in your browser of choice. Copy and paste the following line into the bookmark destination:

javascript: (function() { var siteId = _spPageContextInfo.siteId , webId = _spPageContextInfo.webId , webTitle = _spPageContextInfo.webTitle , listId = _spPageContextInfo.listId , listTitle = _spPageContextInfo.listTitle , userEmail = _spPageContextInfo.userEmail , listTemplateTypeId = _spPageContextInfo.listBaseTemplate , webUrl = _spPageContextInfo.webAbsoluteUrl , webLogoUrl = _spPageContextInfo.webLogoUrl , webTemplate = _spPageContextInfo.webTemplate , isSiteAdmin = (_spPageContextInfo.isSiteAdmin ? 1 : 0) , scope = "OPENLIST"; var oneDriveURL = "odopen://sync?"; oneDriveURL += "siteId="+encodeURIComponent(siteId); oneDriveURL += "&webId="+encodeURIComponent(webId); oneDriveURL += "&webTitle="+encodeURIComponent(webTitle); oneDriveURL += "&listId="+encodeURIComponent(listId); oneDriveURL += "&listTitle="+encodeURIComponent(listTitle); oneDriveURL += "&userEmail="+encodeURIComponent(userEmail); oneDriveURL += "&listTemplateTypeId="+encodeURIComponent(listTemplateTypeId); oneDriveURL += "&webUrl="+encodeURIComponent(webUrl); oneDriveURL += "&webLogoUrl="+encodeURIComponent(webLogoUrl); oneDriveURL += "&webTemplate="+encodeURIComponent(webTemplate); oneDriveURL += "&isSiteAdmin="+encodeURIComponent(isSiteAdmin); oneDriveURL += "&scope="+encodeURIComponent(scope); window.location.href = oneDriveURL; }());

Note: this bookmarklet does not work unless you're in the "Documents" page or a specific document folder of your SharePoint site. It will not work from the root page of a SharePoint site, even if "Shared Documents" are shown on the landing page.

Ben
  • 308
  • 2
  • 13
  • Can someone explain why this bookmarklet doesn't work on site pages? – powerd Feb 04 '21 at 14:00
  • ok apparently _spPageContextInfo is commented out on in the source code for modern pages. https://www.c-sharpcorner.com/blogs/how-to-get-current-context-from-sharepoint-modern-site-page – powerd Feb 04 '21 at 14:15