Powershell to stop inheriting permissions on SharePoint Online library

Install-Module SharePointPnPPowerShellOnline -AllowClobber

$web = Get-PnPWeb -Connection (Connect-PnPOnline "https://XXXXXX.sharepoint.com/sites/XXXXXXX/" -Credentials $cred -ReturnConnection)

$list = Get-PnPList "Document Library" -Web $web

$list.BreakRoleInheritance($true, $true)

$list.Update()

$list.Context.Load($list)

$list.Context.ExecuteQuery()
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...