Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Count number of users in distribution group

$
0
0

Hi,

I need to find all distribution groups that have more than 50 recipient. I tried with this in ems:

$grupe = Get-DistributionGroup
$grupe | Where-Object { (Get-DistributionGroupMember -Identity $_.Name).Count -gt 50 }

And it is working, but if I have group in group it only count 1 and not member in child group. Example:

Group01@test.com

For group01 number is 4, but i need total number of recipinet.



Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>