We are in the process of moving from onsite Exchange to G-Suite for email. In the past we bounced all external email through Gmail before it hit our Exchange server as a backup and spam filter. As a result, everyone's Gmail inboxes are loaded with external emails and they are all unread.

Before I move all users to Gmail I would like to clear out all those emails for all staff, so they get a fresh inbox. Is there a way I can do this without logging into everyone's accounts? I have well over 100 accounts to clear.

  • You probably need to use the Gmail API available for G Suite accounts. Since this is a pretty common use case, odds are a simple example script from the API documentation your favorite language will do this for you, just copy, paste, tweak, run, be a hero :) Documentation: developers.google.com/gmail/api/guides
    – hlecuanda
    Apr 7, 2017 at 1:55

1 Answer 1


I wouldn't suggest deleting these email as the users will not have access to any historical email they sent. I know I'd be F$js%j if I found out all my email is gone. I would suggest pushing a filter to all your users that archives these messages out of the Inbox view.

If email isn't really important I would then just delete all your accounts and create them again. The time to do this would be much faster than either the option above or below.

If you must delete messages in the accounts then you can use the built in Security Investigation Tool that is available on G Suite Enterprise.

Security Investigation Tool

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.