Removing files from Google Drive

7 views
Skip to first unread message

Donnie Mayes

unread,
Sep 21, 2026, 11:21:10 AM (yesterday) Sep 21
to GAM for Google Workspace
When emails come in supposedly from our Superintendent, there's a file that's put in their Google Drive.  Is there a way to scrub all of the accounts that have that file in it with GAM?  I don't want them inadvertently clicking on that file if they see it in their Drive.  

I thought I had the command saved, but I can't find it on my PC.

Thank you!

Donnie 

Confidentiality Notice for Henry R-I School District: This correspondence and any attachments are for the sole use of the intended recipient(s) and may contain confidential or privileged information. Any unauthorized use, disclosure, or distribution is prohibited and may be unlawful. If you are not the intended recipient or a person responsible for delivering this message to the intended recipient(s), please contact the sender and destroy all copies of the original message.

Gabriel Clifton

unread,
Sep 21, 2026, 11:26:59 AM (yesterday) Sep 21
to GAM for Google Workspace
Is this what you were looking for?
gam all users delete drivefile <FileID>
⚠️ Important caveat for the global command:
As GAM loops through your domain, it will successfully delete the file for the owner (or remove the shortcut for those it was shared with). However, once the file is destroyed, GAM could return a "404: File not found" error for every subsequent user it processes. This is expected behavior—it just means the file is already gone.

Ross Scroggs

unread,
Sep 21, 2026, 11:29:12 AM (yesterday) Sep 21
to google-ap...@googlegroups.com
Does the file have a fixed name?
Is this for all users in the workspace or some selected OU or group?

For example,

gam redirect stdout ./DeleteSuperFile.txt redirect stderr stdout ou /Staff purge drivefile name "Name of Superintndent file"

Ross
----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/4af692ae-c79c-4488-b4a3-2bb3bd0134ffn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages