Now, instead removing the groups manually I want to do it with powershell.
Here the script:
$spWeb = Get-SPWeb "http://webapplication/sitecollection"
$spGroups = $spWeb.SiteGroups
Write-Host "This site has" $spGroups.Count "groups"
$groups = $spGroups | ? {$_.Name -like "Records Center Web Service Submitters for*"}
Write-Host "Found" $groups.Count "groups which will be deleted:"
ForEach($group in $groups) {
Write-Host "Deleting" $group.Name "..."
$spGroups.Remove($group.Name)
}
$spWeb.Dispose()
No comments:
Post a Comment