PnP Script reset-files-permission-unique-to-inherited throws list exceeds threshold for large libraries
PnP PowerShell script reset-files-permission-unique-to-inherited throws list exceeds threshold for large libraries. I have an alternate version to work with large libraries ` try { Get-PnPListItem -List $ListName -PageSize 2000 | Where {$.FieldValues.FileRef -like "$FolderServerRelativePath*" -and $.FileSystemObjectType -eq "File" } | ForEach-Object { $hasUniqueRole = Get-PnPProperty -ClientObject $_ -Property HasUniqueRoleAssignments if($hasUniqueRole -eq $true){ Write-host $.FieldValues.FileRef Write-host "Reset Permisison starting for file with id $($.Id)" -ForegroundColor DarkGreen $.ResetRoleInheritance() $.update() $Context.ExecuteQuery() } } } catch { write-host "Error: $($_.Exception.Message)" -foregroundcolor Red }
` @pkbullock , would you recommend refactoring the current code to work with large libraries or shall I add a new scenerio?