I was wondering if there is a script or two that can be run to find out all items that have specific unique permissions and also list WHO has access to the items?

I need to migrate over 3 million documents out of SP2007, but a lot of the documents may have unique, uninherited permissions and I cannot see an automated way of capturing this information.

Sorry I am new to all of this

Thanks for any advice given

  • Sharepoint 2007 didn' had PowerSHell support. you were using stsadm for administartion. You can use server object model with SP 2007 (inside powershell) sharepointdiary.com/2011/05/… – Marek Sarad Mar 20 '19 at 14:41
function Get-ItemsWithUniquePermissions(){
    [Parameter(Mandatory=$true, Position=0)]
    [Parameter(Mandatory=$true, Position=1)]

$date=Get-Date -UFormat "%Y-%m-%d-%H%M"


if(!(Test-Path $folder)){
    New-Item -Path $folder -ItemType directory

if(!(Test-Path $errorLog)){
    New-Item -Path $errorLog -ItemType file

$rootSite = New-Object Microsoft.SharePoint.SPSite($rootSiteUrl)


foreach($web in $webs){
    $lists=$web.lists | ?{$_.hidden -eq $false}
    foreach($list in $lists){
        foreach($item in $items){
            if ($item.HasUniqueRoleAssignments) {
                $itemData= new-object psobject
                $itemData |Add-Member -Type NoteProperty -Name Web -Value "$($web.url)"
                $itemData |Add-Member -Type NoteProperty -Name List -Value $($list.title)
                $itemData |Add-Member -Type NoteProperty -Name Item -Value $($item.id)

                $itemData |Export-Csv -Path "$folder\$filename" -NoTypeInformation -Encoding UTF8 -Append



Get-ItemsWithUniquePermissions -folderPath c:\temp -rootSiteUrl http://dev

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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