PnP PowerShell Archives : Binary Bits https://blog.binarybits.net/tag/pnp-powershell/ Bits & Pieces - A blog by Kannan Balasubramanian Wed, 23 May 2018 03:57:59 +0000 en-GB hourly 1 https://wordpress.org/?v=6.5.2 Enable tree view in current navigation within SharePoint https://blog.binarybits.net/enable-tree-view-in-current-navigation-within-sharepoint/ https://blog.binarybits.net/enable-tree-view-in-current-navigation-within-sharepoint/#respond Wed, 23 May 2018 03:57:59 +0000 https://blog.binarybits.net/?p=985 Sometime we need to enable tree view in current navigation to help navigate within document libraries. Traditional Way: Site Settings -> Look and Feel: Navigation Elements -> Check ‘Enable Tree View’ Programmatic way using PnP Powershell: try { $web = Get-PnPWeb -Includes TreeViewEnabled Write-Host "Setting options to enable tree view..." $web.TreeViewEnabled = $true $web.Update() Invoke-PnPQuery Write-Host […]

The post Enable tree view in current navigation within SharePoint appeared first on Binary Bits.

]]>
Sometime we need to enable tree view in current navigation to help navigate within document libraries.

Traditional Way:

Site Settings -> Look and Feel: Navigation Elements -> Check ‘Enable Tree View’

Programmatic way using PnP Powershell:

try {
    $web = Get-PnPWeb -Includes TreeViewEnabled
    Write-Host "Setting options to enable tree view..."
    $web.TreeViewEnabled = $true        
    $web.Update()
    Invoke-PnPQuery
    Write-Host "Completed."
}
catch {
    $ErrorMessage = $_.Exception.Message
    Write-Host "Error enabling tree view. $ErrorMessage"
}

The post Enable tree view in current navigation within SharePoint appeared first on Binary Bits.

]]>
https://blog.binarybits.net/enable-tree-view-in-current-navigation-within-sharepoint/feed/ 0
Disable ‘Allow items from this site to be downloaded to offline clients’ in SharePoint https://blog.binarybits.net/disable-allow-items-from-this-site-to-be-downloaded-to-offline-clients-in-sharepoint/ https://blog.binarybits.net/disable-allow-items-from-this-site-to-be-downloaded-to-offline-clients-in-sharepoint/#respond Wed, 23 May 2018 03:52:17 +0000 https://blog.binarybits.net/?p=979 Sometime we need to disable the “Sync” button in SharePoint document libraries and that can be done by the following methods. Traditional Way: Site Settings -> Search: Search and offline availability -> Set ‘Allow items from this site to be downloaded to offline clients?’ to “No” Programmatic way using PnP Powershell: try { $web = Get-PnPWeb […]

The post Disable ‘Allow items from this site to be downloaded to offline clients’ in SharePoint appeared first on Binary Bits.

]]>
Sometime we need to disable the “Sync” button in SharePoint document libraries and that can be done by the following methods.

Traditional Way:

Site Settings -> Search: Search and offline availability -> Set ‘Allow items from this site to be downloaded to offline clients?’ to “No”

Programmatic way using PnP Powershell:

try {
    $web = Get-PnPWeb -Includes ExcludeFromOfflineClient
    Write-Host "Setting options to disable 'Allow items from this site to be downloaded to offline clients'..."
    $web.ExcludeFromOfflineClient = $true        
    $web.Update()
    Invoke-PnPQuery
    Write-Host "Completed."
}
catch {
    $ErrorMessage = $_.Exception.Message
    Write-Host "Error disabling offline clients. $ErrorMessage"
}

The post Disable ‘Allow items from this site to be downloaded to offline clients’ in SharePoint appeared first on Binary Bits.

]]>
https://blog.binarybits.net/disable-allow-items-from-this-site-to-be-downloaded-to-offline-clients-in-sharepoint/feed/ 0