Thanks Ryan, this helps but only slightly.
I'm mostly concerned with deployment the Document Libraries and at this time I cannot find a supported way to do this.
It appears that the data is stored in 2 places
%localappdata%\Microsoft\OneDrive\settings\Business1\<ScopeIdGuid>.ini
and in the registry under
HKEY_CURRENT_USER\Software\Microsoft\OneDrive\Accounts\Business1\ScopeIdToMountPointPathCache
REG_SZ <ScopeIdGuid> <Path to sync location>
It _looks_ like the values in the registry control the sync engine while the values in the <ScopeIdGuid>.ini control the Nav Pane in Windows Explorer.
However, Fiddlering the web requests, I cannot figure out how to get the <ScopeIdGuid> itself. It doesn't appear in any of the web requests.
The next best option would be to replicate what happens when the user clicks the Sync button on a document library. It uses the odopen:// protocol route with a bunch of parameters, meaning we could feasibly run Powershell as a logon script like this:
Start-Process "odopen://sync/?
userId=<UserGuid>
siteId=<SiteGuid>
webId=<WebGuid>
listId=<ListGuid>
userEmail=<upn>
webUrl=<url>
isSiteAdmin=0
onPrem=0"
The SiteId can be found programtically using
$context = New-Object Microsoft.SharePoint.Client.ClientContext("https://tenant.sharepoint.com/teams/eric")
$context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credential.UserName,$credential.Password)
$site = $context.Site
$context.Load($site)
$context.ExecuteQuery()
$site.Id
Courtesy of https://sharepoint.stackexchange.com/questions/192281/how-to-get-site-id-or-site-url-for-sharepoint-online-2013-office-365-site-usin
However at this moment I can't figure out how to programatically determine the WebId and ListId parameters. The call doesn't work without them.