User Profile
DeclanTyndall
Copper Contributor
Joined Mar 22, 2023
User Widgets
Recent Discussions
Re: SharePoint - How to Reset Inheritance Permission set into an SP DocLib folder or file
Can you explain what exactly the "IF" portion of the script is doing, similarly to others i was having trouble getting it to run past the discovery phase, i added the below else statement and it would spit out "Failed" the for each item it discovered so the for Loop was working fine. I commented out the "IF" statement and it worked so i think, at least for me, thats where the issue is. if($allItems[$j]["FileRef"].StartsWith($foldertoscope)) { Write-Host "Resetting permissions for " $allItems[$j]["Title"] ".." $allItems[$j]["FileRef"] $allItems[$j].ResetRoleInheritance() $ctx.ExecuteQuery() } else { write-host "Failed" }29KViews0likes0Comments
Recent Blog Articles
No content to show