Delete Distribution Groups Using PowerShell

We had a monster mess where Records Center was enable, and well, it created a TON of groups.
Each of these groups started with Records Center Web Service Submitters ….

Below is the PowerShell to delete the group from a given site. To make things more-funner, it would be better to start at the web app, then loop on the site collections, and sub sites.

$site = Get-SPweb "http://sharepointed.com/sites/TestSite/"

foreach($group in $site.Groups)
	{
		if ($group.Name.Contains("Records Center Web Service Submitters"))
			{
				$site.SiteGroups.Remove($group.Name)
			}
	}
$site.Dispose()

Leave a Reply

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