Emptying Trash from Mail

52 views
Skip to first unread message

Deborah Canales

unread,
Aug 16, 2024, 10:47:14 AM8/16/24
to GAM for Google Workspace
I'm needing some assistance with emptying the trash from a specific user account.  I found this command that can be run:

gam user exa...@domain.com delete messages query "in:trash".  I've tried it with both quotes and no quotes.  Either way, this is what is returned: 

Getting all Messages for exa...@domain.com
Got 1 Message for  exa...@domain.com  ...
User:  exa...@domain.com  , Message: 1, Not Deleted: Use the "doit" argument to perform action

This inbox has upward of 20,000 messages in trash. I'm not sure why it is saying there is only 1 messages to delete.  I did not use the doit argument since I wanted to preview first.

I tried this command with my account that has a couple of deleted emails and the results only show 1 message as well.  Am I doing something wrong here? 

Maj Marshall Giguere

unread,
Aug 16, 2024, 10:55:21 AM8/16/24
to google-ap...@googlegroups.com
Did you append the "doit" option to the end of the command?  GAM will only tell you what it would do unless you say "doit".

gam user exa...@domain.com delete messages query "in:trash" doit


--
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/cbe38f82-f8c7-4887-9ec0-fea68b367245n%40googlegroups.com.

Ross Scroggs

unread,
Aug 16, 2024, 11:13:49 AM8/16/24
to google-ap...@googlegroups.com
gam user exa...@domain.com delete messages query "in:trash" doit max_to_delete 1000000

Ross



--
Message has been deleted

Deborah Canales

unread,
Aug 16, 2024, 5:06:44 PM8/16/24
to GAM for Google Workspace
I'm aware that doit allows the command to take place.  I did it on a test account and still only 1 email was deleted.  Not sure why it is only picking up one messages if I am not deleting by message ID

Ross Scroggs

unread,
Aug 16, 2024, 5:08:01 PM8/16/24
to google-ap...@googlegroups.com
Add the max_to_delete 100000 option.

Ross



--

Maj Marshall Giguere

unread,
Aug 16, 2024, 7:02:38 PM8/16/24
to google-ap...@googlegroups.com
Message has been deleted

Deborah Canales

unread,
Aug 17, 2024, 5:46:06 AM8/17/24
to GAM for Google Workspace
will try that.  Thanks 
Reply all
Reply to author
Forward
0 new messages