Find All Sites and Lists with Unique Permissions

Requirement is to Get the report of SharePoint 2010 (or 2007) Sites and Lists where Permission Inheritance is broken.

PowerShell to Generate a report for Unique Permissions:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get All Web Applications
$webApps = Get-SPWebApplication #"https://sharepoint.company.com"

#Write Header to CSV File 
"Site/List `t Title `t URL" | out-file UniquePermissions.csv

foreach ($webApp in $webApps)
{
	foreach ($site in $webApp.Sites)
	{
		foreach ($web in $site.AllWebs)
		{
			if ( ($web.HasUniqueRoleAssignments) -and ($web.IsRootWeb -eq $false))
			{
				$result ="Site `t $($web.Title) `t $($web.Url)"
				$result | Out-File UniquePermissions.csv -Append 
				#You can get the permissions applied by: $web.permissions | format-list member, basepermissions
			}
			foreach ($list in $web.Lists)
			{
				if (($list.HasUniqueRoleAssignments) -and ($list.Hidden -eq $false))
				{
					$result= "List `t $($list.Title) `t $($list.Url)" 
					$result | Out-File UniquePermissions.csv -Append 
				}
			}
		$web.Dispose()
		}
		$site.Dispose()
	}
}

And the Output file in Excel:

sharepoint find unique permissions

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

8 thoughts on “Find All Sites and Lists with Unique Permissions

  • Will this apply to SP2013/2016

    Reply
  • Hi Rajack,

    Do you have any reference article for getting custom permission levels from root and fetch the report in which or library it has been used?

    Reply
  • Hey Rajack, Do you have similar script in CSOM (Unique Permissions report for SP2013)

    Reply
  • How can we modify it to get folders and files inside that have unique permissions set??

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *