Sunday, October 20, 2013

Disable offline synchronization for all libraries with specific template

Recently we got a requirement to disable offline synchronization for all Picture Libraries in a web application. Reason for the exclusion was that, those libraries contain large amount of pictures which take long time to download to the client.
We use following PowerShell script to disable offline synchronization for all Picture Libraries currently exist in the web application
   1: Start-SPAssignment -global
   2: $webs = Get-SPWebApplication "http://sp13" | Get-SPSite -Limit All | Get-SPWeb -Limit All | Foreach-Object { 
   3: Foreach ($list in $_.Lists | Where-Object { $_.BaseTemplate -eq "PictureLibrary"}){
   4:  $list.ExcludeFromOfflineClient=1; 
   5:  $list.Update()
   6:  }
   7: }
   8: Stop-SPAssignment –global
As a result, the synchronization process skips Picture Libraries

image

No comments: