Home

Disable OneDrive Offline Sync for SharePoint Libraries

%3CLINGO-SUB%20id%3D%22lingo-sub-33531%22%20slang%3D%22en-US%22%3EDisable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33531%22%20slang%3D%22en-US%22%3E%3CP%3EIs%20there%20a%20way%20to%20keep%20offline%20sync%20enabled%20for%20personal%20OneDrive%20for%20Business%20libraries%2C%20but%20disable%20it%20generally%20for%20TeamSite%20libraries%2C%20and%20possibly%20enable%20it%20only%20for%20specific%20libraries%3F%3C%2FP%3E%3CP%3EOr%20do%20you%20have%20any%20other%20suggestion%20to%20limit%20the%20possible%20attack%20scope%20from%20Ransomware%20regarding%20SharePoint%20Libraries%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-33531%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33809%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33809%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20update%20%3A-).%20I%20will%20try%20to%20find%20some%20time%20to%20maybe%20publish%20a%20small%20PS%20snippet%20to%20use%20this%20new%20property%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33807%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33807%22%20slang%3D%22en-US%22%3E%3CP%3ELike%20Richard%20mentioned%2C%20we%20released%20following%20property%20for%20CSOM%20in%20the%20SPO%20NuGet%20package%20back%20in%20August%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3Epublic%20%3CSTRONG%3Eproperty%3C%2FSTRONG%3E%20Microsoft.SharePoint.Client.List.ExcludeFromOfflineClient%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdev.office.com%2Fblogs%2Fnew-sharepoint-csom-version-released-for-Office-365-august-2016-updated.%26nbsp%3BThat%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdev.office.com%2Fblogs%2Fnew-sharepoint-csom-version-released-for-Office-365-august-2016-updated.%26nbsp%3BThat%3C%2FA%3E%20should%20do%20the%20trick.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33720%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33720%22%20slang%3D%22en-US%22%3EThe%20ExcludeFromOfflineClient%20property%20is%20available%20via%20the%20API%20now%2C%20as%20of%20version%2016.1.5715.1200%20I%20believe.%20If%20users%20can%20re-enable%20the%20setting%20you%20will%20still%20have%20to%20disable%20it%20frequently%20unfortunately.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33695%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33695%22%20slang%3D%22en-US%22%3E%3CP%3EI%20think%20you%20are%20right%20and%20it's%20not%20possible%20yet%20to%20configure%20this%20setting%20using%20CSOM...adding%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F369%22%20target%3D%22_blank%22%3E%40Vesa%20Juvonen%3C%2FA%3E%26nbsp%3Bso%20he%20can%20add%20his%20comments%20here%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33662%22%20slang%3D%22en-US%22%3ERe%3A%20RE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33662%22%20slang%3D%22en-US%22%3E%3CP%3ELast%20time%20my%20team%20looked%20at%20this%2C%20there%20was%20no%20API%20(PowerShell%2C%20CSOM%2C%20etc.)%20that%20would%20allow%20you%20to%20do%20this.%20%26nbsp%3BWe%20had%20to%20write%20some%20custom%20code%20to%20mimic%20the%20get%2Fpost%20requests%20for%20the%20advanced%20settings%20page%20of%20a%20library%20in%20order%20to%20turn%20off%20%22offline%20client%20availability%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESince%20our%20users%20could%20turn%20it%20back%20on%20at%20any%20point%2C%20we%20have%20to%20run%20our%20utility%20continuously%20in%20order%20to%20keep%20it%20disabled.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-33536%22%20slang%3D%22en-US%22%3ERE%3A%20Disable%20OneDrive%20Offline%20Sync%20for%20SharePoint%20Libraries%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-33536%22%20slang%3D%22en-US%22%3EYeap%2C%20you%20can%20do%20it%20per%20library%20basics%20and%20in%20order%20to%20automate%20I'm%20pretty%20sure%20you%20can%20write%20some%20PowerShell%20code%20to%20do%20it%20using%20CSOM....as%20an%20example%3A%20%3CA%20href%3D%22http%3A%2F%2Fwww.sharepointdiary.com%2F2014%2F09%2Fhow-to-disable-sync-button-in-sharepoint-2013.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fwww.sharepointdiary.com%2F2014%2F09%2Fhow-to-disable-sync-button-in-sharepoint-2013.html%3C%2FA%3E%20(the%20PowerShell%20is%20not%20valid%20because%20is%20for%20server%20side)%3C%2FLINGO-BODY%3E
Highlighted
Ivan Unger
Valued Contributor

Is there a way to keep offline sync enabled for personal OneDrive for Business libraries, but disable it generally for TeamSite libraries, and possibly enable it only for specific libraries?

Or do you have any other suggestion to limit the possible attack scope from Ransomware regarding SharePoint Libraries?

6 Replies
Yeap, you can do it per library basics and in order to automate I'm pretty sure you can write some PowerShell code to do it using CSOM....as an example: http://www.sharepointdiary.com/2014/09/how-to-disable-sync-button-in-sharepoint-2013.html (the PowerShell is not valid because is for server side)

Last time my team looked at this, there was no API (PowerShell, CSOM, etc.) that would allow you to do this.  We had to write some custom code to mimic the get/post requests for the advanced settings page of a library in order to turn off "offline client availability".

 

Since our users could turn it back on at any point, we have to run our utility continuously in order to keep it disabled.

I think you are right and it's not possible yet to configure this setting using CSOM...adding @Vesa Juvonen so he can add his comments here

The ExcludeFromOfflineClient property is available via the API now, as of version 16.1.5715.1200 I believe. If users can re-enable the setting you will still have to disable it frequently unfortunately.

Like Richard mentioned, we released following property for CSOM in the SPO NuGet package back in August

 

  • public property Microsoft.SharePoint.Client.List.ExcludeFromOfflineClient

 

https://dev.office.com/blogs/new-sharepoint-csom-version-released-for-Office-365-august-2016-updated... should do the trick.

Thanks for the update :-). I will try to find some time to maybe publish a small PS snippet to use this new property
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
38 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
12 Replies