GAM command to count emails

377 views
Skip to first unread message

Uthayaseelan Rasalingam

unread,
Jun 10, 2024, 9:08:28 AM6/10/24
to GAM for Google Workspace
Hi,

I'm looking for GAM command to count all emails received during a specific date range from one email address. Could anyone please help with the correct command?

Thanks

Ross Scroggs

unread,
Jun 10, 2024, 10:46:31 AM6/10/24
to google-ap...@googlegroups.com

Advanced GAM


See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Messages-Threads#display-messagesthreads


gam user us...@domain.com print messages query "from:em...@xyz.com after:2024/05/01 before:2024/06/05" includespamtrash countsonly


Adjust us...@domain.com, em...@xyz.com and dates as required.


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/2be516a3-8871-4aa1-bffe-05846608dd96n%40googlegroups.com.


--

Uthayaseelan Rasalingam

unread,
Jun 10, 2024, 11:13:25 AM6/10/24
to GAM for Google Workspace
This is the GAM command i'm running and is giving out error.

ERROR: messages is not a valid argument for "gam <users> print"

gam user us....@domain.com print messages query "after:2022/01/01 before:2022/03/30" includespamtrash countsonly

GAM version I'm using is 5.11

What I'm trying to achieve is to find out the amount of emails received for a specific email address during a specific time range.

Thanks

Ross Scroggs

unread,
Jun 10, 2024, 11:22:18 AM6/10/24
to google-ap...@googlegroups.com
That is a veroy old version of Standard GAm. you need Advanced GAM.


Ross



--

Uthayaseelan Rasalingam

unread,
Jul 8, 2024, 9:02:05 AM7/8/24
to GAM for Google Workspace
I have upgraded the GAMADV-XTD3 to 6.77.08

How far back can i go back and do the search, I'm trying to search back to 2021 and is not giving me any data.

Ross Scroggs

unread,
Jul 8, 2024, 10:35:34 AM7/8/24
to google-ap...@googlegroups.com
Here is the query documentation, it doesn't mention limits: https://support.google.com/mail/answer/7190

I am getting data from 2021.

Ross
----
Ross Scroggs



Shubham Pawar

unread,
Apr 14, 2025, 10:16:24 AMApr 14
to GAM for Google Workspace
Hi Ross,

I have tried the above command but getting the error "Gmail API Service/App not enabled" for users. I have checked the below items
1. Account is active
2. Gmail service is on
3. User has GWS license

Ross Scroggs

unread,
Apr 14, 2025, 11:46:51 AMApr 14
to google-ap...@googlegroups.com
Send me a private MeetZoom invitation and we'll investigate.


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.
Reply all
Reply to author
Forward
0 new messages