Help deleting a phishing with a subject

2,781 views
Skip to first unread message

Chris Medina

unread,
Jun 15, 2018, 9:34:18 AM6/15/18
to GAM for G Suite
I am trying to delete bulk email by subject using :   gam all users delete messages query "subject:'Bad Email Subject'" doit
I get a WARNING: refusing to delete ANY messages for 12...@domain.com since max messages to process is 1 and messages to be deleted is 3   (12345 is the users name for example)
How can I delete more than say 10 messages for a user?

Jay Lee

unread,
Jun 15, 2018, 9:37:25 AM6/15/18
to google-ap...@googlegroups.com
Try:

gam print users | gam csv - gam user ~primaryEmail delete messages query "subject:Bad Email Subject" doit maxtodelete 1
  • Using "gam print users" and piping it into CSV allows GAM to run against 20 users at a time instead of single file. The process will go MUCH quicker.

  • The maxtodelete NN argument tells GAM how many messages it's allowed to delete from a user's mailbox and defaults to zero. We want to play it really safe when deleting user data.
Jay

--
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 post to this group, send email to google-ap...@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/ad40f917-8bbd-41e3-a302-a94b349b1c5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

✉ Kevin Melillo

unread,
Jun 15, 2018, 9:40:44 AM6/15/18
to google-ap...@googlegroups.com
gam all users delete messages query "subject:'Bad Email Subject' AND after:2018/06/14" max_to_delete 10 doit 

To be safe, I would also use the AND after: modifier, so you will only delete emails for that subject that came after the bad email started.  


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

Chris Medina

unread,
Jun 15, 2018, 10:03:15 AM6/15/18
to google-ap...@googlegroups.com
Thanks for all the help it's working.

On Fri, Jun 15, 2018 at 9:40 AM, ✉ Kevin Melillo <k.me...@ieee.org> wrote:
gam all users delete messages query "subject:'Bad Email Subject' AND after:2018/06/14" max_to_delete 10 doit 

To be safe, I would also use the AND after: modifier, so you will only delete emails for that subject that came after the bad email started.  
On Fri, Jun 15, 2018 at 9:37 AM Jay Lee <jay...@gmail.com> wrote:
Try:

gam print users | gam csv - gam user ~primaryEmail delete messages query "subject:Bad Email Subject" doit maxtodelete 1
  • Using "gam print users" and piping it into CSV allows GAM to run against 20 users at a time instead of single file. The process will go MUCH quicker.

  • The maxtodelete NN argument tells GAM how many messages it's allowed to delete from a user's mailbox and defaults to zero. We want to play it really safe when deleting user data.
Jay

On Fri, Jun 15, 2018 at 9:34 AM Chris Medina <crme...@aggies.ncat.edu> wrote:
I am trying to delete bulk email by subject using :   gam all users delete messages query "subject:'Bad Email Subject'" doit
I get a WARNING: refusing to delete ANY messages for 12...@domain.com since max messages to process is 1 and messages to be deleted is 3   (12345 is the users name for example)
How can I delete more than say 10 messages for a user?

--
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.

--
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.
--
Kevin Melillo
Electronic Communications Analyst
Information Technology

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

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