SOLVED

Script for Automatic Syncing

%3CLINGO-SUB%20id%3D%22lingo-sub-178408%22%20slang%3D%22en-US%22%3EScript%20for%20Automatic%20Syncing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178408%22%20slang%3D%22en-US%22%3E%3CP%3EWe%20have%20the%20%22Silently%20configure%20OneDrive%20using%20primary%20Windows%20Account%22%20Option%20enabled%20in%20our%20Active%20Directory%20which%20set%20ups%20a%20primary%20Onedrive.%20However%2C%20we%20have%20certain%20circumstances%20where%20a%20user%20will%20have%20access%20to%20a%20secondary%20OneDrive.%20Is%20there%20a%20way%20via%20AD%2C%20Intune%2C%20or%20a%20Powershell%20script%20to%20automatically%20configure%20access%20to%20a%20secondary%20OneDrive%3F%20Thanks%20in%20advance%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-178408%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESync%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-179467%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20for%20Automatic%20Syncing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-179467%22%20slang%3D%22en-US%22%3E%3CP%3EPerfect...exactly%20what%20I%20needed%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-178730%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20for%20Automatic%20Syncing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178730%22%20slang%3D%22en-US%22%3ENote%3A%20Onedrive%20for%20Business%20sites%20%3D%20Sharepoint%20sites%2C%20Onedrive%20sites%20also%20have%20an%20ID%20for%20example.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-178729%22%20slang%3D%22en-US%22%3ERe%3A%20Script%20for%20Automatic%20Syncing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-178729%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3E%22If%20you%20want%20to%20auto-configure%20a%20SharePoint%20site%20to%20be%20synced%2C%20you%20can%20use%20the%20URL%20below%20as%20a%20guide%20to%20build%20the%20path%20to%20the%20SharePoint%20site%20you%20want%20to%20sync%20automatically.%20Replace%20HERE%20with%20the%20correct%20values%20for%20each%20component%20of%20the%20URL.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3ENote%3A%20Replace%20special%20characters%20like%20the%20period%20(.)%2C%20hyphen%20(-)%2C%20and%20at%20sign%20(%40)%20with%20the%20corresponding%20encoded%20values.%20For%20example%2C%20if%20the%20URL%20includes%20a%20hyphen%2C%20replace%20the%20hyphen%20with%20its%20encoded%20value%2C%26nbsp%3B%3CSTRONG%20class%3D%22ocpLegacyBold%22%3E%252D%3C%2FSTRONG%3E.%20Additionally%2C%20you%20will%20need%20Client%20Side%20Object%20Model%20(CSOM)%20knowledge%20to%20query%20the%20team%20site%20to%20determine%20the%20appropriate%20SiteID%2C%20WebID%20and%20ListID%20to%20build%20the%20appropriate%20URL.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CEM%3Eodopen%3A%2F%2Fsync%2F%3FsiteId%3DSiteID_HERE%26amp%3BwebId%3DWebID_HERE%26amp%3BlistId%3DListID_HERE%26amp%3BuserEmail%3DUserEmail_HERE%26amp%3BwebUrl%3DWebURL_HERE%22%3C%2FEM%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3ESource%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fdeploy-the-new-onedrive-sync-client-in-an-enterprise-environment-3f3a511c-30c6-404a-98bf-76f95c519668%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsupport.office.com%2Fen-us%2Farticle%2Fdeploy-the-new-onedrive-sync-client-in-an-enterprise-environment-3f3a511c-30c6-404a-98bf-76f95c519668%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Deleted
Not applicable

We have the "Silently configure OneDrive using primary Windows Account" Option enabled in our Active Directory which set ups a primary Onedrive. However, we have certain circumstances where a user will have access to a secondary OneDrive. Is there a way via AD, Intune, or a Powershell script to automatically configure access to a secondary OneDrive? Thanks in advance?

3 Replies
Highlighted

"If you want to auto-configure a SharePoint site to be synced, you can use the URL below as a guide to build the path to the SharePoint site you want to sync automatically. Replace HERE with the correct values for each component of the URL.

Note: Replace special characters like the period (.), hyphen (-), and at sign (@) with the corresponding encoded values. For example, if the URL includes a hyphen, replace the hyphen with its encoded value, %2D. Additionally, you will need Client Side Object Model (CSOM) knowledge to query the team site to determine the appropriate SiteID, WebID and ListID to build the appropriate URL.

odopen://sync/?siteId=SiteID_HERE&webId=WebID_HERE&listId=ListID_HERE&userEmail=UserEmail_HERE&webUrl=WebURL_HERE"


Source: https://support.office.com/en-us/article/deploy-the-new-onedrive-sync-client-in-an-enterprise-enviro...

Highlighted
Best Response
Solution
Note: Onedrive for Business sites = Sharepoint sites, Onedrive sites also have an ID for example.
Highlighted

Perfect...exactly what I needed