Help searching the content of all files stored on shared drives.

32 views
Skip to first unread message

Zed Kolk

unread,
Mar 4, 2026, 8:33:16 AM (2 days ago) Mar 4
to GAM for Google Workspace
Hello all, first time posting here👋

The following gam command works for searching files in all users’ mydrives:gam all users show filelist query "fullText contains 'keyword'" fields id,title,owners,alternatelink

I’m trying to figure out how to do something similar for Shared Drives.I already have a CSV that includes an id  with the drive IDs of every Shared Drive, and it@ is a service account that is added to every Shared Drive.

However, I still can’t figure out the actual gam command I need to make to search shared drives.I assume it is something like this (but this gives syntax errors so obvi it’s not it):gam csv "$ids_file" gam user i...@domain.com show filelist drive ~id query "fullText contains 'keyword'" fields id,title,owners,alternatelink

I had hopes that this message posted in this Google Group would be the answer, but it doesn’t find this test file I have stored on a shared drive.Screenshot 2026-03-04 at 2.17.26 PM.pngScreenshot 2026-03-04 at 2.18.54 PM.png

Ross Scroggs

unread,
Mar 4, 2026, 11:19:34 AM (2 days ago) Mar 4
to google-ap...@googlegroups.com

gam redirect csv ./SharedDriveInfo.csv multiprocess redirect stderr - multiprocess csv "$ids_file" gam user i...@domain.com print filelist select shareddriveid ~id query "fullText contains 'keyword'" fields id,title,alternatelink

For a Google sheet result: redirect csv - multiprocess todrive

Ross
----
Ross Scroggs



I had hopes that this message posted in this Google Group would be the answer, but it doesn’t find this test file I have stored on a shared drive.<Screenshot 2026-03-04 at 2.17.26 PM.png><Screenshot 2026-03-04 at 2.18.54 PM.png>

--
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/8ca35d46-b30d-4061-ab91-e386d3b0a9dan%40googlegroups.com.
<Screenshot 2026-03-04 at 2.17.26 PM.png><Screenshot 2026-03-04 at 2.18.54 PM.png>

Zed Kolk

unread,
Mar 5, 2026, 8:12:10 AM (yesterday) Mar 5
to GAM for Google Workspace
Thanks for your reply,
As it turns out, I think I was able to get it to work with this: gam csv $ids_file gam user $it_email_address print filelist fullquery "fullText contains 'keyword'" select teamdriveid ~id showownedby any id title filepath >> "$sharedDriveOutput"
Reply all
Reply to author
Forward
0 new messages