PowerShell

PowerShell – Find SharePoint Group Assignments

This PowerShell script will enumerate through all sites in the collection and return any sites that contain a given group name. Replace the red text, Administrative Members with the name of the group.

# Get All Web Application
$webApp=Get-SPWebApplication
# Get All site collections
foreach ($SPsite in $webApp.Sites)
{
# get the collection of webs
foreach($SPweb in $SPsite.AllWebs)
{
foreach($SPG in $SPweb.Groups)
{
if ($SPG.Name -eq “Administration Members“)
{
Write-Host $SPweb.Name
}
}
}
}

About the author

Leave a Reply