Count of each user's Inbox

656 views
Skip to first unread message

robby-215

unread,
Jun 15, 2023, 12:06:47 PM6/15/23
to GAM for Google Workspace
Hello,

We have a customer that is hoping to be able to get a count of how many messages their users currently have in their inbox, ideally by read and unread, but only the inbox, no other labels.  Is this possible with GAM?

Ross Scroggs

unread,
Jun 15, 2023, 1:08:22 PM6/15/23
to google-ap...@googlegroups.com
Advanced GAM

gam redirect csv ./InboxReadCounts.csv all users print messages query "label:inbox is:read" countsonly

gam redirect csv ./InboxUnreadCounts.csv all users print messages query "label:inbox is:unread" countsonly


Ross


On Thu, Jun 15, 2023 at 9:06 AM 'robby-215' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
Hello,

We have a customer that is hoping to be able to get a count of how many messages their users currently have in their inbox, ideally by read and unread, but only the inbox, no other labels.  Is this possible with GAM?

--
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/97495091-5293-45c3-9ba4-3cd0a1047d5cn%40googlegroups.com.


--

robby-215

unread,
Jun 15, 2023, 6:36:16 PM6/15/23
to GAM for Google Workspace
Awesome, thank you!  Worked great!

James SEYMOUR

unread,
Jun 15, 2023, 8:39:56 PM6/15/23
to GAM for Google Workspace
Out of curiosity, how would you run this command (on Linux) when you have ! in the label name?

I have a top level label called ! and then a sub-label called !Action. So the full label is label:!-!action. When running this in a query I get -bash: !-!action: event not found.

Running through different " and ' options did not help. Adding a \ before each ! stopped the bash error, but there was no output. So gam user <My Email> print messages query "label:\!-\!action is:unread" runs but does not show the 3 messages that are unread.

I know I could change the ! to an _ (underscore) but just interested in what quoting format is needed for the !

Cheers

James

Maj Marshall Giguere

unread,
Jun 15, 2023, 9:15:58 PM6/15/23
to google-ap...@googlegroups.com
Gentlemen;

Put your query in single quotes to avoid shell expansion.

Maj Marshall E Giguere

NH Wing Director of IT

Civil Air Patrol, U.S. Air Force Auxiliary

GoCivilAirPatrol.com

nhwg.cap.gov

Volunteers serving America's communities, saving lives, and shaping futures.



James SEYMOUR

unread,
Jun 15, 2023, 9:23:49 PM6/15/23
to GAM for Google Workspace
Many thanks. This made me look at the query again and when using the single quotes I needed to remove the \ so the query becomes query 'label:!-!action is:unread'
Reply all
Reply to author
Forward
0 new messages