Delete Email from Users Inbox

1,122 views
Skip to first unread message

Adam Houdek

unread,
Mar 4, 2024, 2:32:37 PM3/4/24
to google-ap...@googlegroups.com
Hello,

Can I use GAM to delete an email from select user's inbox? 

Thanks,
Adam

Ian Crew

unread,
Mar 4, 2024, 2:36:27 PM3/4/24
to GAM for G Suite
--
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/CAN%3DM9c6%2BUB1RzU7ZsWHP36viKByHa661GygZPk4zGDPbkOVpQw%40mail.gmail.com.

Ross Scroggs

unread,
Mar 4, 2024, 2:36:32 PM3/4/24
to google-ap...@googlegroups.com

Adam Houdek

unread,
Mar 4, 2024, 2:51:00 PM3/4/24
to google-ap...@googlegroups.com
Tried to find message ID with, "gam user bob....@yourdomain.com print messages query "\"New org chart next year\"" headers subject,to,message-id" but getting a messages is not valid error.

Obviously changed the bob.smith to my user and the "New org chart next year" to the subject of the email.

Thanks,
Adam

Jay Lee

unread,
Mar 4, 2024, 2:52:06 PM3/4/24
to google-ap...@googlegroups.com

Adam Houdek

unread,
Mar 4, 2024, 2:53:04 PM3/4/24
to google-ap...@googlegroups.com
ERROR: messages is not a valid argument for "gam <users> print"

Thanks,
Adam

Ross Scroggs

unread,
Mar 4, 2024, 2:58:26 PM3/4/24
to google-ap...@googlegroups.com
You're running Standard GAM, it has no print messages command.

You can try this with Standard GAM.

gam user bob....@yourdomain.com delete messages query "\"New org chart next year\"" 
If it finds a message to delete it will say so but will not actually delete it unless you add this to the end of the command: doit

That way you won't delete mre messages that you intend.

Ross
----
Ross Scroggs



Adam Houdek

unread,
Mar 4, 2024, 3:08:44 PM3/4/24
to google-ap...@googlegroups.com
I found the message ID from my Google Admin Console, the command " gam config auto_batch_min 1 all users delete message query "MESSAGE ID>" doit' returned an error ERROR: config is not a valid argument for "gam".

Is this because I have Stand GAM, too? What do I have to do to get the other version of GAM?

Thanks,
Adam

Ross Scroggs

unread,
Mar 4, 2024, 3:14:10 PM3/4/24
to google-ap...@googlegroups.com

Adam Houdek

unread,
Mar 4, 2024, 3:16:57 PM3/4/24
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages