Jun 15 2017 05:07 AM
Hi
How do I break inheritance on a list or web using PnP PowerShell ?
Must be with PowerShell running on a client NOT on the SharePoint server.
Thanks
Nigel
Jun 15 2017 06:47 AM
SolutionHi @Nigel Price
I've got a list called Testlist in the root of my site collection that I connected to with ConnectPnPOnline.
The following 6 lines now do what you need:
$web = Get-PnPWeb -Identity "/" $spoList= Get-PnPList "Testlist" -Web $web $spoList.BreakRoleInheritance($true, $true) $spoList.Update() $spoList.Context.Load($spoList) $spoList.Context.ExecuteQuery()
Jun 15 2017 06:52 AM
Thanks @Pieter Veenstra marked as solution
Feb 04 2020 10:41 PM
Jun 15 2017 06:47 AM
SolutionHi @Nigel Price
I've got a list called Testlist in the root of my site collection that I connected to with ConnectPnPOnline.
The following 6 lines now do what you need:
$web = Get-PnPWeb -Identity "/" $spoList= Get-PnPList "Testlist" -Web $web $spoList.BreakRoleInheritance($true, $true) $spoList.Update() $spoList.Context.Load($spoList) $spoList.Context.ExecuteQuery()