Get Distribution Groups of a certain size (member count)

Brass Contributor

I've been tasked with getting/reporting distribution groups of 100 members or more, and specifically the sending restrictions applied to them. 


We are a large tenant with over 100,000 users and over 4000 groups.  


Is there a GUI way to do this, or must I use PowerShell?


With PowerShell, I can get all groups and their sending restrictions, but what's the quickest way to simply get the number of members in the group, including nested members?  

4 Replies
best response confirmed by Roger Seekell (Brass Contributor)

if you have hybrid identities, you can query local ad group members Get-ADGroupMember.

Run a loop to get member count for each group..

Best you can do in O365 is create a report of each group's membership and use the count there. Here's a sample script I wrote a while back: How to inventory membership of Exchange Groups, recursively (

@RNalivaika Thank you. I did something like this, as it was quicker to get members from on-prem AD than Exchange Online.  However, it didn't complete the solution, as I never did find a way to count the members of cloud-only DLs.  

@Vasil Michev Thank you. I will try your script; it may be the solution for the cloud-only groups I have yet to count.