Forum Discussion
Khalid Hajjouji
Dec 24, 2018Copper Contributor
How to disable offline sync on site collection level in powershell clientside?
I now it is possible to enable/disable the offline sync option on list or site level. But I would like to this in powershell clientside. For example by Office Dev PnP. I have full controll access to ...
Thuyavan Ganesan
Dec 24, 2018Steel Contributor
Yes its possible you can loop through each site in each site collection. On each site loop through each list and set this parameter:
$list.ExcludeFromOfflineClient = true;
Full example:
$site = Get-SPSite <your site collection url>
foreach ($web in $site.AllWebs)
{
write-host "Site: $web"
foreach($list in $web.lists){
$list.ExcludeFromOfflineClient = true
$list.update();
}
}
$site.dispose()
Let me know
$list.ExcludeFromOfflineClient = true;
Full example:
$site = Get-SPSite <your site collection url>
foreach ($web in $site.AllWebs)
{
write-host "Site: $web"
foreach($list in $web.lists){
$list.ExcludeFromOfflineClient = true
$list.update();
}
}
$site.dispose()
Let me know