Script to find all Site Owners

In SharePoint 2013 by rhodzyLeave a Comment

A handy little script to export site owners to a CSV file, edit the items within bold

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

Get-SPSite -Limit All |
Get-SPWeb -Limit All |
where { $_.HasUniquePerm -and $_.AssociatedOwnerGroup -ne $null } |
foreach {
$url = $_.Url; $title = $_.Title; $_ } |
Select -ExpandProperty AssociatedOwnerGroup |
Select -ExpandProperty Users |
Select {$url}, {$title}, UserLogin, DisplayName | Export-csv “E:\Scripts\SiteOwners\Owners_$(get-date -format `”yyyymmdd_hhmmtt`”).csv” -NoTypeInformation