Forum Discussion
Salvatore Biscari
Jan 28, 2017Silver Contributor
Script to mass disable sync for Office 365 Groups
A customer of mine wants to disable sync for all Groups doclibs.
AFAIK there is not a global setting for this.
I know that it is possible to do it manually for every single doclib in the advanced library settings, but such approach is impractical for hundreds of Groups.
Can someone point me to an existing script for doing it for all Groups in a tenant?
TIA.
I am sorry, but I do not know of any way to disable the ability for users to synchronize a document library via PowerShell...
- Salvatore BiscariSilver Contributor
Thank you, Tony.
- You should be able to "temporary" hide the "sync" action in the Groups Library using CSOM (Client Side Object Model) in a PowerShell script...and I say "should" because in the past I have found some weird problems when using CSOM with Groups sites...but this should not be the case anymore since a Group site is a modern site. By the way, I have a script that hides the sync action for a document library in SPO using CSOM: https://gallery.technet.microsoft.com/How-to-enabledisable-sync-8ad53996?redir=0 (Bear in mind you will need to use at least August 2016 version of CSOM...I recommend you to use the once released by Microsoft yesterday (https://jcgonzalezmartin.wordpress.com/2017/01/28/office-365-january-version-of-spo-csom-just-released/)....and to get the CSOM assemblies via NuGet using PowerShell just follow this post: https://jcgonzalezmartin.wordpress.com/2017/01/09/tips-tricks-how-to-install-a-nuget-package-without-visual-studio-installed/
Finally, you will need to buy the code to get the all the Groups sites in the tenant. You can use this post as a starting point : http://www.andrewjbillings.com/enumerating-sharepoint-sites-for-office-365-groups-with-powershell/