Forum Discussion
Script to mass disable sync for Office 365 Groups
My two cents:
- Correct. You can do it manually in the UI, library by library. Or by a script.
- IMHO correct.
- IMHO correct.
- Correct. My concern is that the condition $Library.BaseTemplate -eq "101" in Brent's script captures (hence setting ExcludeFromOfflineClient=$true) also other "system" libraries and not only the (possibly multiple) "user" document libraries in each Group. Is it safe doing so?
- IMHO correct. (e.g. point 4 should be evaluated carefully).
Library.BaseTemplate = 101 specifies document libraries belonging to Office 365 Groups... Or all modern sites?
In the past, Groups used a special Group#0 template for its sites. Is that the same now (in an airplane with limited wi-fi so don't want to go through the slowwwwwww network check...) Maybe someone knows offhand.
- TonyRedmondJan 30, 2017MVP
Should that comment be "users sometimes do silly things"?
Never mind...
- Jan 30, 2017:-) Users some times want to do unexpected things...@Salvatore if the template ID approach does not work for you, use the document library name instead and read the document libraries names for every group form a CSV you have created beforehand
- TonyRedmondJan 30, 2017MVP
I can't think of why a user would want or attempt to synchronize these libraries...
- Salvatore BiscariJan 30, 2017Silver Contributor
My feeling is that it is not important if synchronization is disabled for these "system" libraries (and anyway users never synchronize them, I think), but I would like to have an "authoritative" answer... :smileyvery-happy:
- TonyRedmondJan 30, 2017MVP
I guess I need more context. I do not think that the "system" document libraries are used by Office 365 Groups - unless someone can shed more light on this topic. If that is the case, then it might not be important if synchronization was disabled for these libraries. Do users ever synchronize them anyway?
- Salvatore BiscariJan 30, 2017Silver Contributor
Nevertheless, my question still remains unanswered...
I will try to be more clear.
We know the following facts:
- In every Group we have a main "user" document library (with template ID 101). In Italian it is called: Documenti.
- In every Group we also have what I would call "system" document libraries (with template ID 101). In Italian they are called: Modelli di modulo, Raccolta stili, Risorse del sito.
- In every Group we can create other "user" document libraries (with template ID 101).
All this said, if we want to hide the sync button in all "user" libraries by means of a script, and we select the libraries on the basis of template ID 101, we will (try to) hide the sync button also in the "system" document libraries (point 2) and not only in the "user" document libraries (point 1 and point 3).
My question is: is this safe?
(Of course in the script I can select the "user" document libraries "by name", but while this is easily feasible for the "main" one (point 1 above), it is instead difficult for the others (point 3 above))...
- TonyRedmondJan 30, 2017MVP
Ta. Like everywhere in Office 365, if you take your eyes off the ball for a few minutes, things might change...
Good to know about the identifiers for document libraries. I like factoids like that!
- Jan 30, 2017Sorry guys for not joining on time to the party :-)...here my comments:
- 101 is the template ID for any document librarie in SharePoint (no matter if we talk about SharePoint OnPremises or Online, Modern Team Sites or Classic ones, or Groups sites)
- GROUPS#0 identifies the site template used for a Group site...but in a site you can create Document Libraries and lists and for them you have a template ID: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splisttemplatetype.aspx
In regards of Tony's questions:
1. Correct
2. Correct (hiding the Sync option is just a cosmetic customization)
3. Correct
4. Correct
5. Of course :-)