Quantcast
Channel: SharePoint Diary
Viewing all articles
Browse latest Browse all 1058

Get All SharePoint Site Collection Owners - Report

$
0
0
Requirement is to find out owners of each SharePoint site collection in the environment.We needed this data to get approvals on critical changes and to inform site owners prior to maintenance windows.

Simple! Use STSADM command:
On SharePoint 2007 and above, STSADM command can be used to get primary owner details of site collections:
Syntax:
stsadm -0 enumsites -url <web-app-url>
E.g.
stsadm -0 enumsites -url "http://sharePoint.crescent.com" > SitesRpt.xml

This command enumerates all site collections and pulls site owner information. It also retrieves secondary owner, content database in which site collection exist and storage details of the site collection. Just open the generated XML file with Microsoft Excel.

Find Site Owner for All site collections using PowerShell:
For SharePoint 2007 Sites, The PowerShell script to get site Owners for all Site collections would be:
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")

$WebAppUrl = "http://sharepoint.crescent.com" #Read-Host "Enter Web Application URL:"
$rootSite = New-Object Microsoft.SharePoint.SPSite($WebAppUrl)

#Get the Web Application from Site Collection
$WebApp = $rootSite.WebApplication

foreach($site in $WebApp.Sites)
{
Write-Host "$($Site.Url) - $($Site.Owner) : $($Site.Owner.Email)"
$site.Dispose()
}

Get All Site Owners in SharePoint 2010/2013:
On SharePoint 2010 and above, we can retrieve owner information with a single line of code:
Add-PSSnapin "Microsoft.SharePoint.Powershell" -ErrorAction SilentlyContinue

Get-SPWebApplication "http://sharepoint.crescent.com" | Get-SPSite | foreach-object { Write-host $_.Url - $_.Owner.Email}

Get me all Site collections I own:
This time, I had to find out all site collections a particular user owns. No worries, PowerShell is so powerful!

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

Get-SPSite -Filter {$_.Owner -EQ "Global\Salaudeen"} -limit 100

For SharePoint Site Collection Administrators report, Refer: Site Collection Administrators Report for All SharePoint Sites

Viewing all articles
Browse latest Browse all 1058

Trending Articles