Powershell to get SharePoint group by ID

function Get-SPGroup($web, $id){
	$SPSite = Get-SPSite $web
	foreach($SPWeb in $SPWebCollection){
		foreach($SPGroup in $SPWeb.Groups){
			if ($SPGroup.ID -eq $id){
				$SPGroup
			}
		}
	}
}

Usage: Get-SPGroup https://cf.peter.com 705

Leave a Reply

Your email address will not be published. Required fields are marked *