Generate member count for each group in domain - to include groups within a group

610 views
Skip to first unread message

Justin Juneau

unread,
Apr 6, 2023, 4:47:26 PM4/6/23
to GAM for Google Workspace
Scenario: You have 1,000+ distribution groups in a G-workspace domain. 

The Task:
-Generate a list containing all groups. 
-List the number of members in each group
-Some groups have distribution groups within them. Determine the number of users in these distribution groups and update the 'parent group' member count accordingly.

The first two items are relatively easy using 'GAM print groups'. 

The challenge: Some of these groups contain members and groups. 

Does GAM have a way to recurse/iterate through these 'sub-group's and update the member count accordingly? 

I've been dabbling with a python script I created that is able to generate the list of groups along with the member count. However, I'm running into the same challenge of the groups within a group part. 

Ideally, there is a solution I have not come across with GAM. If that isn't the case, maybe a solution exists in Python or another programming language. If that doesn't exist, is there a third party app that can do this for free? 

Ross Scroggs

unread,
Apr 6, 2023, 4:59:33 PM4/6/23
to google-ap...@googlegroups.com
Justin,

Try this with Advanced GAM

gam print groups includederivedmembership countsonly members owners managers


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/cf4ee360-5039-4485-a8f7-ec428a42cafen%40googlegroups.com.


--

Justin Juneau

unread,
Apr 6, 2023, 6:24:23 PM4/6/23
to GAM for Google Workspace
You sir are an absolute legend, THANK YOU!!! 
Reply all
Reply to author
Forward
0 new messages