Powershell Script to Find Owners of Document Library SharePoint

Add-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue

$SiteUrl = "https://portal.contoso.com"
$SiteCollection = Get-SPSite $SiteUrl
foreach($web in $SiteCollection.AllWebs)
{
    foreach($list in $web.Lists)
    {
        if($list.BaseType -eq "DocumentLibrary" -and $list.Hidden -eq $false)
        {
            if($list.Permissions.Inherited -eq $false)
            {
                foreach($Perm in $list.Permissions)
                {
                    if($Perm.PermissionMask -eq "FullMask")
                    {
                        Write-Host $web.Url, $list.Title $Perm.Member -ForegroundColor Green
                    }
                }
            }
        }
    }
    $web.Dispose()
}
$SiteCollection.Dispose()
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s