SharePoint Full Farm Site Collection Admin report SharePoint Full Farm Site Collection Admin report
Joel Plaut

Joel Plaut

February 27, 2013

All Post
SharePoint-Full
Share:

Reporting on SharePoint Full Farm Site Collection Admins

Site Collection Administrators retain a great deal of power and capability within a SharePoint Site Collection. Wouldn’t it be nice to know are the Site Collection admins across an entire farm? This script will generate a report that is easily loaded and pivoted in Excel. First, let’s pick a column separator that’s not in use by any of the fields. This is a bit of a challenge, because with Claims based authentication, there’s quite a few characters in use that precludes them being a separator. Here’s the script:

 

$Sep="~"
 Write-Host "WebApp$($sep)SiteCollection$($sep)UserName$($sep)UserLogin"
 $spWebApps = get-spwebapplication
 
 foreach ($spWebApp in $spWebApps)
 {
    foreach($site in $spWebApp.Sites)
    {
        foreach($siteAdmin in $site.RootWeb.SiteAdministrators)
        {
            Write-Host "$($spWebApp.Name)$($sep)$($siteAdmin.ParentWeb.Url)$($sep)$($siteAdmin.DisplayName)$($sep),$($siteAdmin.UserLogin)"
        }
        $site.Dispose()
    }
    $spWebApp=$null; #this is not an IDisposable object
}

Leave a Reply

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

Want to talk?

Drop us a line. We are here to answer your questions 24*7.