GAM7 - find all files or folders of an external person

36 views
Skip to first unread message

Alex Grutza

unread,
Jun 1, 2026, 1:22:57 PM (7 days ago) Jun 1
to GAM for Google Workspace
We've been asked to find (and remove) all access for a specific external email address (exa...@gmail.com). 

The end-user who requested this has gone through their Share Drives but wanted to make sure that the exa...@gmail.com account is completely removed from all access of all of our organization data.

Gemini is shyte when it comes to formulating the command..

This is the first attempt where the gemini command didn't crap out on syntax

gam all users print filelist query "'exa...@gmail.com' in readers or 'exa...@gmail.com' in writers" id title > external_shares.csv

Ross Scroggs

unread,
Jun 1, 2026, 3:21:23 PM (6 days ago) Jun 1
to google-ap...@googlegroups.com
That's the  correct general idea.

To delete the shares you'll do:

gam redirect stdout ./DeleteExternalShares.txt multiprocess redirect stderr stdout csv external_shares.csv gam user "~Owner" delete drivefileacl "~id" exa...@gmail.com

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/27265efd-b189-4725-82ce-ff9b77381875n%40googlegroups.com.

Alex Grutza

unread,
Jun 2, 2026, 9:59:20 AM (6 days ago) Jun 2
to GAM for Google Workspace
Thanks for the delete command. I'm going to just go through specific OUs and then combine the csv. Hope that at least grabs all the permissions of everyone from the OUs and identifies this exa...@gmail.com we'll see. I wish there was a more native way (blocking external sharing is not possible for Higher Ed) for users on the Education Fundamentals :(

gam ou "/employees" print filelist fields id,title,owners.emailAddress,permissions > .\employee_permissions.csv

Ross Scroggs

unread,
Jun 2, 2026, 11:59:45 AM (6 days ago) Jun 2
to google-ap...@googlegroups.com
Send me a private Meet/Zoom invitation if you like to discuss your options.

Ross
----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages