Groups with no members in them are, in my opinion, a waste of a perfectly good object
So here is a function to find groups that have no users and no groups as member…
function Get-EmptyGroups { $Groups = Get-ADGroup -Filter * -Properties members foreach ($Group in $Groups) { $GroupMembers = $Group | Select-Object -ExpandProperty members if ($groupmembers -eq $null) { $Group.Name } } }