SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using following Powershell script to break the folder permissions inside the Record Libraries:

    $webUrl = 'http://intranet'
    $web = Get-SPWeb $webUrl;
    $SPBaseTypeDocumentLibrary = [Microsoft.SharePoint.SPBaseType]::DocumentLibrary
    $lists = $web.GetListsOfType($SPBaseTypeDocumentLibrary);
    foreach ($list in $lists)
    if ($list.BaseTemplate.ToString() -eq "1302")
    $folders = $list.Folders
    foreach ($spFolder in $folders)
        # Add claims to folder
        $folderName = $spFolder.Name
        $claimToken = "c:0-.t|clientcontracts|" + $folderName
        $claimUserDisplayName = "Claim User " + $folderName  
        $roleAssignment = New-Object microsoft.sharepoint.SPRoleAssignment($claimToken,"",$claimUserDisplayName,"")


The issue is that the script is gets very sluggish. I have about 100 Libraries and each library contains 1000 folders. Is there any way to improve the performance of this script? How can we break permissions of folders in batches?

share|improve this question
up vote 2 down vote accepted

This really isnt a PowerShell issue. Instead it clearly stipulates why setting unique permissions (especially alot of different ACL's) on items/folders in a SharePoint list is not recommended, especially for large lists.

I would recommend rethinking the design...

@james-love also made a couple of posts on his blog on this issue

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.