List all files for a specific user ( owned and shared )

3,708 views
Skip to first unread message

Shane McGovern

unread,
Jan 23, 2023, 7:12:34 AM1/23/23
to GAM for Google Workspace
Hi all , 

I was looking through the previous conversations but I'm unable to get the command I truly want 

Essentially I'd like a list of all files / folders that a user has access to. 
From the other threads there was commands listed such as 

$ gam user me@domain  show filelist fullquery "sharedWithMe=True" showownedby any
Getting all Drive Files/Folders that match query (sharedWithMe=True) for me@domain
Got 50 Drive Files/Folders that matched query (sharedWithMe=True) for me@domain...
Owner,name,webViewLink


However I have access to much more than 50 files when looking through the shared folders with me. 
Is there anything else I should be doing ? 

For reference the task would be for me to get all the files a user has access to within our company domain



Ross Scroggs

unread,
Jan 23, 2023, 10:58:09 AM1/23/23
to google-ap...@googlegroups.com
Shane,

gam user me@domain print filelist anyowner id title mimetype owners


Ross


--
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/4adb8cda-9875-48ff-af2d-9e8b14a57585n%40googlegroups.com.


--

Shane McGovern

unread,
Jan 23, 2023, 11:39:04 AM1/23/23
to GAM for Google Workspace

Thank you that seemed to work to a degree , it's now showing 133 files. 
But there's definitely files which aren't appearing.


Perhaps my approach is wrong , would it be more sensible to instead track which folders ( shared and personal ) the person has access to. 

was looking at 
$ gam print teamdriveacls user me@domain fields role

which prints the high level shared drivers but doesn't go deeper into subfolders. Is there any methods I can use for that ?



Ross Scroggs

unread,
Jan 23, 2023, 12:13:35 PM1/23/23
to google-ap...@googlegroups.com
Shane,

Send me a Meet/Zoom invitation and I'll help investigate.

Ross



--

Shane McGovern

unread,
Jan 23, 2023, 1:08:30 PM1/23/23
to GAM for Google Workspace
Just incase others come across the same issue. 
From talking to Ross , shared drives work differently and the default behaviour of the API is to check your drive and shared directly with you. 

$ gam user me@domain print filelist anyowner id title mimetype owners corpora alldrives

Will list the files for the entire organisation
Reply all
Reply to author
Forward
0 new messages