How do I search for all files that a particular user has access to?

758 views
Skip to first unread message

omi

unread,
Sep 4, 2023, 4:52:57 AM9/4/23
to GAM for Google Workspace
Hi,

I'm looking for a way to get the ID of all files that a particular user has access to.

This is a way to retrieve only the list of files owned by the user in question.

gam redirect csv ./files.csv user 
<User Email Address> print filelist fields id,title,permissions,owners.emailaddress todrive

I have tried the following command but it just generates an empty list.

gam user <User Email Address> print filelist fullquery "sharedWithMe=True" showownedby others allfields todrive

thank you for your input,

Ross Scroggs

unread,
Sep 4, 2023, 10:01:48 AM9/4/23
to google-ap...@googlegroups.com
Try this:
gam user <User Email Address> print filelist showownedby others allfields todrive

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 on the web visit https://groups.google.com/d/msgid/google-apps-manager/75961efa-1fb6-4f1f-be16-ec14579b6772n%40googlegroups.com.

omi

unread,
Sep 5, 2023, 5:56:58 AM9/5/23
to GAM for Google Workspace
Thank you Ross

Are the commands you have presented valid even if I am only a group member and have not been granted direct permissions?
Unfortunately, it seems that accounts nested in a group cannot retrieve files that are shared by the parent group.

Best
2023年9月4日月曜日 23:01:48 UTC+9 Ross Scroggs:

Matthew Roerdink

unread,
Sep 7, 2023, 8:31:04 PM9/7/23
to GAM for Google Workspace
Hey Gentlepeople,

I need to perform a similar task, but when I try Ross's suggested command (gam user <User Email Address> print filelist showownedby others allfields todrive) I'm getting an error:
ERROR: showownedby is not a valid argument for "gam <users> show filelist"

Is this an argument only supported by Advanced GAM? Or am I doing something else wrong?

Ross Scroggs

unread,
Sep 7, 2023, 8:39:19 PM9/7/23
to google-ap...@googlegroups.com
With Standard GAM do this:
gam user <User Email Address> print filelist fullquery "not 'me' in owners" allfields todrive

Ross
----
Ross Scroggs


Matthew Roerdink

unread,
Sep 7, 2023, 9:13:56 PM9/7/23
to GAM for Google Workspace
Thanks Ross. That did something. 

I now get:
Getting files for test...@domain.com...
Got 33 Files for test...@domain.com...
Temporary error: internalError, Backing off: 16 seconds, Retry: 4/10
Temporary error: internalError, Backing off: 32 seconds, Retry: 5/10
Temporary error: internalError, Backing off: 60 seconds, Retry: 6/10
Temporary error: internalError, Backing off: 60 seconds, Retry: 7/10

Any ideas?

I'm installing Advanced GAM now and I'll try to see if that works...

Ross Scroggs

unread,
Sep 7, 2023, 9:16:37 PM9/7/23
to google-ap...@googlegroups.com
Send me a Meet/Zoom invitation
----
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.

Matthew Roerdink

unread,
Sep 7, 2023, 10:45:12 PM9/7/23
to GAM for Google Workspace
For anyone's future reference. This "Temporary error: internalError," was caused by me simply not having given file creation rights to the Drive owner where the output was going. (Drive and Docs > Features and Applications > Creating new files on Drive > Allow users to create and upload any file). I had not ever used "todrive" to output results before :) 

Thanks to Ross for setting me on the right path!

Reply all
Reply to author
Forward
0 new messages