command to list all files anyone can open

33 views
Skip to first unread message

Juraj Mr.

unread,
Jan 15, 2026, 5:20:03 AM (6 days ago) Jan 15
to GAM for Google Workspace
Hi.
I'm new with GAM tool and I've read it might help me with the following case.
I spend few hours setting it up so it can show some reports from our workspace but I'm not that good with the commands.
As workspace admin, I'd like to list and export all files that have permission to view "anyone with the link".
Would like to have the file name, it's ID, Owner, and path to the file on the share drive or personal drive.

From what I read so far if the file is in the personal My Drive, the share drive would be empty and I can find out owner of the My Drive in the Owner column.

I'm able to list the files in the admin portal using investigation tool, but there are no file paths and this make the audit too time consuming.

I tried googling around, but I found few years old posts with commands and python scripts and they were not exactly what I'm looking for.
As there might be "new way" of doing it and I'm not a programmer (zero python skills so far), I did not take the challenge try and play with those.

If anyone can help out and point me to the right direction, I would appreciate it.

Thank you.
Juraj

Ross Scroggs

unread,
Jan 15, 2026, 10:59:14 AM (6 days ago) Jan 15
to google-ap...@googlegroups.com

My Drives

For all users get files shared with anyoneWithLink
gam config auto_batch_min 1 num_threads 20 redirect csv ./MyDriveAnyoneWithLinkFiles.csv multiprocess redirect stderr - multiprocess all users print filelist fields id,name,mimetype,basicpermissions filepath query "visibility = 'anyoneWithLink'" pm type anyone withlink true em pmfilter oneitemperrow

Shared Drives

Get list of Shared Drives and an organizer/manager
gam redirect csv ./SharedDriveOrganizers.csv print shareddriveorganizers
Any Shared Drive without an organizer won't be process, you should add an organizer/manager

For every Sharied Drive with an organizer get files shared with anyoneWithLink
gam config num_threads 20 csv_input_row_filter "organizers:regex:^.+$" redirect csv ./SharedDriveAnyoneWithLinkFiles.csv multiprocess redirect stderr - multiprocess csv SharedDriveOrganizers.csv gam user "~organizers" print filelist select shareddriveid "~id" fields id,name,mimetype,basicpermissions,driveid showdrivename filepath query "visibility = 'anyoneWithLink'" pm type anyone withlink true em pmfilter oneitemperrow

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/adaa64aa-ff67-456d-8a18-a153b7f86e27n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages