[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) > $null

$farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
$websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
$webapps = @()

foreach ($websvc in $websvcs)
{
foreach ($webapp in $websvc.WebApplications)
{
foreach ($site in $webapp.Sites)
{
write-host $site.URL
foreach ($web in $site.AllWebs)
{
write-host $web.URL
foreach ($group in $web.Groups)
{
$G = $group.Name
if ($G -match “owner”)
{
write-host ”  –>” $G
foreach ($user in $group.Users)
{
write-host ”     –>” $user.Name
write-host “”
}
}
}
}
}

}
}
GO

Show Buttons
Hide Buttons

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.