SOLVED

Get Distribution Groups of a certain size (member count)

%3CLINGO-SUB%20id%3D%22lingo-sub-1952382%22%20slang%3D%22en-US%22%3EGet%20Distribution%20Groups%20of%20a%20certain%20size%20(member%20count)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952382%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20been%20tasked%20with%20getting%2Freporting%20distribution%20groups%20of%20100%20members%20or%20more%2C%20and%20specifically%20the%20sending%20restrictions%20applied%20to%20them.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20a%20large%20tenant%20with%20over%20100%2C000%20users%20and%20over%204000%20groups.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20GUI%20way%20to%20do%20this%2C%20or%20must%20I%20use%20PowerShell%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20PowerShell%2C%20I%20can%20get%20all%20groups%20and%20their%20sending%20restrictions%2C%20but%20what's%20the%26nbsp%3B%3CEM%3Equickest%3C%2FEM%3E%20way%20to%20simply%20get%20the%20number%20of%20members%20in%20the%20group%2C%20including%20nested%20members%3F%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1952382%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1952728%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20Distribution%20Groups%20of%20a%20certain%20size%20(member%20count)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1952728%22%20slang%3D%22en-US%22%3E%3CP%3Eif%20you%20have%20hybrid%20identities%2C%20you%20can%20query%20local%20ad%20group%20members%20Get-ADGroupMember.%3C%2FP%3E%3CP%3ERun%20a%20loop%20to%20get%20member%20count%20for%20each%20group..%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1953046%22%20slang%3D%22en-US%22%3ERe%3A%20Get%20Distribution%20Groups%20of%20a%20certain%20size%20(member%20count)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1953046%22%20slang%3D%22en-US%22%3E%3CP%3EBest%20you%20can%20do%20in%20O365%20is%20create%20a%20report%20of%20each%20group's%20membership%20and%20use%20the%20count%20there.%20Here's%20a%20sample%20script%20I%20wrote%20a%20while%20back%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fpractical365.com%2Fblog%2Fhow-to-inventory-membership-of-exchange-groups-recursively%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHow%20to%20inventory%20membership%20of%20Exchange%20Groups%2C%20recursively%20(practical365.com)%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional 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 (Occasional Contributor)
Solution

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 (practical365.com)

@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.