Search email logs for certain subject using GAM

3,927 views
Skip to first unread message

Becky Jones

unread,
Jan 22, 2018, 2:49:46 AM1/22/18
to GAM for G Suite
Hi,

Does anyone know if its possible to use GAM to search for an email with a certain subject?
I need to find an email which is over 30 days old, I do not have vault and all I have is the email subject to go on.

Can anyone suggest the correct command?

✉ Kevin Melillo

unread,
Jan 22, 2018, 8:40:22 AM1/22/18
to google-ap...@googlegroups.com
gam all users delete messages query subject:dinner

If you want to ACT on the messages, include doit at the end

gam all users delete messages query subject:dinner doit



The information contained in this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you are not the intended recipient of this e-mail, the use of this information or any disclosure, copying or distribution is strictly prohibited and may be unlawful. If you received this e-mail in error, please contact the sender immediately and delete the material from any computer.

The views expressed in this e-mail may not necessarily be the views of Hayley Group Limited and should not be taken as authority to carry out any instruction contained within.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/a33a2b74-02bb-41c4-b956-1b551525a913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331

Mostafa Samman

unread,
Oct 30, 2019, 9:32:17 AM10/30/19
to GAM for G Suite
hello any update I want this cmd plz 

Ross Scroggs

unread,
Oct 30, 2019, 11:22:53 AM10/30/19
to google-ap...@googlegroups.com
Mostafa,

Is this for a single user or multiple users? Are you looking for a message currently in the mailbox or was in the mailbox at some time in the past.
With Advanced GAM (https://github.com/taers232c/GAMADV-XTD3) you can search for messages.

Indented format:

gam user us...@domain.com show messages query "subject:'Message Subject here'"

CSV format:

gam user us...@domain.com print messages query "subject:'Message Subject here'"


Add includespamtrash to the command if you want to search those labels as well.


Ross



--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/f160d72e-5fff-4941-ba3c-f9f6ac01a8b5%40googlegroups.com.


--

James SEYMOUR

unread,
Oct 30, 2019, 10:23:12 PM10/30/19
to GAM for G Suite
Hi Ross,

I looked this and used this command as a test.

gam user my.email print messages query "subject:'Digital Transformation in Action'" todrive

The resulting gSheet gave 7 messages but 6 of them were not correct. They had Digital Transformation in their subject but not the word Action. Is this expected? The other Subjects were "Building your Digital Transformation Team" and "Invitation to IT Event by Advantel & Wiki Labs  : Adopting New Secured Technology Platform for Digital Transformation".

Cheers

James


On Wednesday, 30 October 2019 23:22:53 UTC+8, Ross Scroggs wrote:
Mostafa,

Is this for a single user or multiple users? Are you looking for a message currently in the mailbox or was in the mailbox at some time in the past.
With Advanced GAM (https://github.com/taers232c/GAMADV-XTD3) you can search for messages.

Indented format:

gam user us...@domain.com show messages query "subject:'Message Subject here'"

CSV format:

gam user us...@domain.com print messages query "subject:'Message Subject here'"


Add includespamtrash to the command if you want to search those labels as well.


Ross



On Wed, Oct 30, 2019 at 6:32 AM Mostafa Samman <mostaf...@gmail.com> wrote:
hello any update I want this cmd plz 

On Monday, January 22, 2018 at 9:49:46 AM UTC+2, Becky Jones wrote:
Hi,

Does anyone know if its possible to use GAM to search for an email with a certain subject?
I need to find an email which is over 30 days old, I do not have vault and all I have is the email subject to go on.

Can anyone suggest the correct command?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.


--
Ross Scroggs

Ross Scroggs

unread,
Oct 31, 2019, 8:38:11 AM10/31/19
to google-ap...@googlegroups.com
James,

Try the same query in Gmail; the query documentation is fairly sparse on quoting.

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/15b885c1-157b-487e-be2e-f2240fcf68f1%40googlegroups.com.

James SEYMOUR

unread,
Oct 31, 2019, 7:34:20 PM10/31/19
to GAM for G Suite
Hi Ross,

Using the dropdown search box and searching for Digital Transformation in Action gives a single result.

Cheers

James


On Thursday, 31 October 2019 20:38:11 UTC+8, Ross Scroggs wrote:
James,

Try the same query in Gmail; the query documentation is fairly sparse on quoting.

Reply all
Reply to author
Forward
0 new messages