Skip to main content
Horton Scientific

Microsoft migration script

Repair SharePoint List Permissions (Break & Copy)

```powershell

Repair SharePoint List Permissions (Break & Copy)

Use at your own risk. Test in non-prod first.

Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/YourSite -Interactive
$lists = Get-PnPList
foreach ($l in $lists) {
  Write-Host "Processing $($l.Title)"
  Set-PnPList -Identity $l -BreakRoleInheritance -CopyRoleAssignments -EnableSharingForGuestUsers:$false -ErrorAction SilentlyContinue
}

Let’s move your business forward

What can we help
you do next?