Purge Drive content for user

318 views
Skip to first unread message

Derrick P

unread,
Jul 6, 2022, 9:44:49 PM7/6/22
to GAM for Google Workspace
Is there a GAM command to purge all content in a user Drive and delete them permanently? 
We have a unique use case where we need to reuse an account and we wanted to keep the emails, calendar...etc but not the Drive content. I'm looking for a way to delete all or purge all if it's possible.

Thanks all,

Derrick

Secured by Paubox - HITRUST CSF certified Secured by Paubox - HITRUST CSF certified

Ross Scroggs

unread,
Jul 6, 2022, 10:03:36 PM7/6/22
to google-ap...@googlegroups.com
Derrick,

This should do what you want.
# Empty the trash
gam user us...@domain.com empty drivetrash
# Get a list of files that the user owns
gam user us...@domain.com print filelist id > userfiles.csv
# Purge them
gam csv userfiles.csv gam user "~Owner" delete drivefile "~id" purge

Ross
--
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/5365ea86-322f-4874-92b1-98b82bdf467an%40googlegroups.com.

Derrick P

unread,
Jul 8, 2022, 8:16:51 PM7/8/22
to GAM for Google Workspace
Thanks Ross, I'll try it out.

Josh Townsend

unread,
Nov 2, 2022, 5:14:38 PM11/2/22
to GAM for Google Workspace
Hello.
A similar request, is there a way we can purge "all" files from multiple users at once from their Google Drive, including their Trash. (the purging the trash command could be it's own command if needed).
We have a request asking "is there was an easy way to delete old in-active students' google drive/data on the admin side without deleting the accounts."

I'm wondering if we can do purge all Google Drive files by all the suspended users in 1 OU? Or, can we get a csv file with a list of all user email addresses from that OU, and run a command to purge all the Google Drive data of emails from this csv file?

thanks.
Reply all
Reply to author
Forward
0 new messages