Jim Garrison

unread,
Jan 8, 2026, 8:34:05 PM (3 days ago) Jan 8
to GAM for Google Workspace
Is there any way to query the total number of messages in a Google Group (within my domain)? I know how to query in the context of a specific sender, but there doesn't seem to be a way to issue a global query for the entire group regardless of sender.  

Clearly the Groups web interface has access to this, but I haven't been able to find anything in the API or GAM that would allow this.

Is this just not possible?

Jim Garrison

unread,
Jan 8, 2026, 8:43:36 PM (3 days ago) Jan 8
to GAM for Google Workspace
To clarify, I know about something like

gam all users print messages query "to:gr...@mydomain.org" countsonly

But that will iterate over all users in my domain and miss messages posted by non-domain users.

All query methods seem to start from the context of the sending user(s), whereas I would like a query that starts from the group and returns a count of messages regardless of the individual sender.

Ross Scroggs

unread,
Jan 8, 2026, 10:59:20 PM (3 days ago) Jan 8
to google-ap...@googlegroups.com
JIm,

Try this:

gam config auto_batch_min 1 num_threads 10 redirect csv ./GroupMessageCounts.csv multiprocess redirect stderr - multiprocess group gr...@mydomain.org print messages query "list:gr...@mydomain.org" includespamtrash countsonly


Yes, you'll be an error for non-domain group members, ignore them.


Take the highest count, i.e, the user who never purges messages.

You could replace "group gr...@mydomain.org" with "user mem...@mydomain.org" if you know who that user is.


The sender is irrelenant.


Ross


----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/2ff0f7f2-bb1e-4cc3-a978-c8c0d5967b98n%40googlegroups.com.

Jim Garrison

unread,
Jan 9, 2026, 1:45:23 PM (2 days ago) Jan 9
to GAM for Google Workspace
Interesting... as a Group Admin I can view all groups in my domain.  However, the query you provided lists more posts than I can see through the groups.google.com UI.

In one example, I see 13 messages, but the query says one user has 28.  I would have expected that I'd see all 28 in the web UI.  What am I missing?
Reply all
Reply to author
Forward
0 new messages