Get-SPSite | % {$_.RootWeb.AssociatedOwnerGroup.Users} | select @{name='Url';expr={$_.ParentWeb.Url}}, LoginName, Email
If you are on WSS v.3/MOSS 2007 use the next defenition for Get-SPSite
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | Out-Null
function Get-SPSite{
$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$farm.services | % {if($_.WebApplications.Count){$_.WebApplications}} | % {if($_.sites.Count){$_.sites}}
}
Do you know how I could modify to display all Primary Site collection Administrators along with their email addresses for all web applications.
I have been struggling to get the email address.
Get-SPSite | % {$_.RootWeb.SiteAdministrators} | select @{name=’Url’;expr={$_.ParentWeb.Url}}, LoginName, Email
Great. Is there a way to do this with SubSites too? I assume using Get-SPWeb.
I was also curious, any way to get sub-sites???????
Chopping off the full URL so never see the site names 😦