Searching for messages by sender, saving to Drive?

254 views
Skip to first unread message

Gil Poulsen

unread,
Sep 7, 2019, 7:12:01 AM9/7/19
to GAM for G Suite
Hi, hoping someone can shed some light on structuring a GAM query for email messages. I was able to find all documents that contain a particular text string by using

gam all users show filelist query "fullText contains 'search text'" todrive

So i wanted to do the same for email messages. I have tried dozens of combinations of 

gam all users print messages query 'from:emaila...@domain.com'
gam all users print messages match sender 'from:emaila...@domain.com'
etc. etc.

but all error with not a valid command. I was able to use

gam all users delete messages query 'from:emaila...@domain.com'

to determine that there were a number of messages that matched my search, but I do not want ot delete them. I want to save them to a Google Sheet, or get all their message IDs, or do something that would allow me to view them. I cannot find any matching command in the GAM Wiki to do this. Is it even possible?

Jay Lee

unread,
Sep 7, 2019, 7:14:19 AM9/7/19
to google-ap...@googlegroups.com
What's the end goal here? This sounds like it'd be better achieved in Google Vault..



--
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/02f6f625-485a-43f7-b29d-22dacc371779%40googlegroups.com.

Gil Poulsen

unread,
Sep 7, 2019, 7:16:51 AM9/7/19
to google-ap...@googlegroups.com
Hi, Jay. The end goal would be to get a list of all matching messages by ID, or create a Google Sheet with a list of the messages showing whose account the messages were sent to, a direct link to the message itself, etc. Kinda like what the filelist query for a text string does for documents.
> To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CA%2BVVBp8gLax%2B-OO%3DvNG-rjP4Zgap9%3D8UKRK2k66aXi3hqk7uiQ%40mail.gmail.com.

--
Gil Poulsen, IT Guy

************************
Star News Group
13 Broad Street
Manasquan, NJ 08736
Voice/SMS: (908) 623-0853
************************

Jay Lee

unread,
Sep 7, 2019, 7:22:27 AM9/7/19
to google-ap...@googlegroups.com
Gmail doesn't work like Drive, the link for a message in a user's mailbox is unique to that user, it won't work for other users.

Again this sounds like a problem better solved in Vault or possibly the Investigation Tool:



Gil Poulsen

unread,
Sep 7, 2019, 7:26:23 AM9/7/19
to google-ap...@googlegroups.com
Ah, I see. That looks like a really nifty tool; unfortunately this client is using the Legacy Free edition so we miss out on a lot of this neat stuff ;-( I will investigate Google Vault as well. Also just want to say thank you for GAM, I have done things for my clients that appear to be nothing short of miraculous to them when it was just a one-line query in GAM.
> To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CA%2BVVBp88p0_%3DwrzK%3Ds2rVmaZcaURyn%3DxkoWy4xpRWB173KXDkg%40mail.gmail.com.

Ross Scroggs

unread,
Sep 7, 2019, 9:37:05 AM9/7/19
to google-ap...@googlegroups.com
Gil,

gam all users print messages query 'from:emailaddress@domain.com'
This command is supported in Advanced GAM (https://github.com/taers232c/GAMADV-XTD3)

Ross
On Sep 7, 2019, at 4:12 AM, Gil Poulsen <i...@thecoaststar.com> wrote:

Hi, hoping someone can shed some light on structuring a GAM query for email messages. I was able to find all documents that contain a particular text string by using

gam all users show filelist query "fullText contains 'search text'" todrive

So i wanted to do the same for email messages. I have tried dozens of combinations of 

gam all users print messages query 'from:emailaddress@domain.com'
gam all users print messages match sender 'from:emailaddress@domain.com'
etc. etc.

but all error with not a valid command. I was able to use

gam all users delete messages query 'from:emailaddress@domain.com'

to determine that there were a number of messages that matched my search, but I do not want ot delete them. I want to save them to a Google Sheet, or get all their message IDs, or do something that would allow me to view them. I cannot find any matching command in the GAM Wiki to do this. Is it even possible?

Gil Poulsen

unread,
Sep 7, 2019, 11:14:59 AM9/7/19
to google-ap...@googlegroups.com
Thanks for the info, Ross! I will check that out ASAP.

> On Sep 7, 2019, at 9:36 AM, Ross Scroggs <ross.s...@gmail.com> wrote:
>
> Gil,
>
>> gam all users print messages query 'from:emaila...@domain.com'
> This command is supported in Advanced GAM (https://github.com/taers232c/GAMADV-XTD3)
> See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Gmail-Messages-Threads#display-messagesthreads
>
> Ross
>
> --
> ross.s...@gmail.com
>
>
>
>> On Sep 7, 2019, at 4:12 AM, Gil Poulsen <i...@thecoaststar.com> wrote:
>>
>> Hi, hoping someone can shed some light on structuring a GAM query for email messages. I was able to find all documents that contain a particular text string by using
>>
>> gam all users show filelist query "fullText contains 'search text'" todrive
>>
>> So i wanted to do the same for email messages. I have tried dozens of combinations of
>>
>> gam all users print messages query 'from:emaila...@domain.com'
>> gam all users print messages match sender 'from:emaila...@domain.com'
>> etc. etc.
>>
>> but all error with not a valid command. I was able to use
>>
>> gam all users delete messages query 'from:emaila...@domain.com'
>>
>> to determine that there were a number of messages that matched my search, but I do not want ot delete them. I want to save them to a Google Sheet, or get all their message IDs, or do something that would allow me to view them. I cannot find any matching command in the GAM Wiki to do this. Is it even possible?
>>
>>
>> --
>> 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/02f6f625-485a-43f7-b29d-22dacc371779%40googlegroups.com.
>
>
> --
> 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/7E6761C3-EE7C-498F-A8B2-37191DAF34FF%40gmail.com.

Ross Scroggs

unread,
Sep 7, 2019, 11:21:14 AM9/7/19
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages