gam user name print filelist query based on size of file

1,402 views
Skip to first unread message

Alexander Grutza

unread,
Dec 1, 2021, 9:54:48 AM12/1/21
to GAM for Google Workspace
Is there an easy way to get a list of Drive files for a user that are larger than X?

I have the following but nothing is outputted. I know that there probably has to be some piping but I don't know how the query command works and I can't find resources on it.

gam user jdoe print filelist query  "size > 4096" id title size

If I do the following it outputs the size obviously
gam user jdoe show fileinfo id-of-single-file size

Ross Scroggs

unread,
Dec 1, 2021, 10:36:02 AM12/1/21
to google-ap...@googlegroups.com
Alexander,


With Advanced GAM you can do the following:
gam user jdoe print filelist minimumfilesize 4096 id title size


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/a5846a43-3df0-428c-b7ca-d32548c5a76dn%40googlegroups.com.


--

Alexander Grutza

unread,
Dec 1, 2021, 11:20:16 AM12/1/21
to GAM for Google Workspace
Thank you for that link and help. I'm running into an issue which I guess I don't understand. I am typing in exactly what the error is showing and it's failing (https://github.com/taers232c/GAMADV-XTD3/wiki/Drive-File-Selection#select-MIME-type)

----------------
gam user jdoe print filelist minimumfilesize 52428800 showmimetype application title
Command: C:\GAMADV-XTD3\gam.exe user jdoe print filelist minimumfilesize 52428800 showmimetype >>>application<<< title

ERROR: Invalid choice (application): Expected <(application|audio|font|image|message|model|multipart|text|video)/mediatype|g3pshortcut|gdirectory|gdoc|gdocument|gdrawing|gfile|gfolder|gform|gfusion|gfusiontable|gmap|gpresentation|gscript|gsheet|gshortcut|gsite|gspreadsheet|shortcut>
Help: Syntax in file C:\GAMADV-XTD3\GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki
-------------


Is showmimetype application|image the same as doing the following?
gam user jdoe print filelist minimumfilesize 52428800 query "mimeType='image/jpeg' or mimeType contains 'application/x-dosexec'" title

Ross Scroggs

unread,
Dec 1, 2021, 11:28:26 AM12/1/21
to google-ap...@googlegroups.com
Alexander,

You have to specify a type and subtype, e.g., application/pdf

application|audio|font|image|message|model|multipart|text|video)/mediatype

Are you looking for specific MimeTypes?

Ross



--

Ross Scroggs

unread,
Dec 1, 2021, 11:36:45 AM12/1/21
to google-ap...@googlegroups.com
Alexander,

Try this:
gam user jdoe print filelist minimumfilesize 52428800 query "mimeType contains 'application'" title

Ross



--

Alexander Grutza

unread,
Dec 1, 2021, 11:36:50 AM12/1/21
to GAM for Google Workspace
We would be yes. Take the following for example. It will output all files over 50MB that match either jpeg or application mimetypes. I was just confused as there wasn't a clear example on resources I found of what "showmimetype <MimeTypeList>" looked like. And from my simple understanding, the query (below) would be able to do the same thing for our purposes

gam user jdoe print filelist minimumfilesize 52428800 query "mimeType='image/jpeg' or mimeType contains 'application'"
Reply all
Reply to author
Forward
0 new messages