Show Filecounts on a Specific Directory

94 views
Skip to first unread message

Jason Wang

unread,
May 20, 2026, 4:51:12 PMMay 20
to GAM for Google Workspace
Good day everyone,

Recently I used this command to get the filecounts for a particular drive:

gam user joe.b...@RedPublishing.com show filecounts select teamdrive "RedPublishing"

Worked wonderfully! My next hope: is there a similar command that I can point at just a specific directory inside the drive RedPublishing? [i.e. I want the same analysis, but just for one particular directory that I specify.]

Ross Scroggs

unread,
May 20, 2026, 4:55:20 PMMay 20
to google-ap...@googlegroups.com
Get the ID of the folder of interest.
gam user joe.b...@RedPublishing.com show filecounts select <FolderIDHere>

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/da272877-cc3d-4e8a-ac86-391c84243bd6n%40googlegroups.com.

Jason Wang

unread,
May 26, 2026, 4:04:51 PM (13 days ago) May 26
to GAM for Google Workspace
Hi Ross, 

It didn't take, unfortunately. As a sanity check I ran:

gam user joe....@RedPublishing.com show filecounts select teamdrive "RedPublishing"


and this worked exactly the same as it did previously. I then switched to:


gam user joe....@RedPublishing.com show filecounts select teamdrive 1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv


where that last string is the tail of the URL to the folder I am trying to inspect.


(i.e. the hypothetical link for this example is https://drive.google.com/drive/u/0/folders/1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv.)


This is the result:

Show Failed: Shared drive not found: 1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv

Ross Scroggs

unread,
May 26, 2026, 4:07:13 PM (13 days ago) May 26
to google-ap...@googlegroups.com
You want the following, drop the word teamdrive.
gam user joe....@RedPublishing.com show filecounts select 1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv

Ross
----
Ross Scroggs


Jason Wang

unread,
May 26, 2026, 4:12:44 PM (13 days ago) May 26
to GAM for Google Workspace
Same error came back again: 

Getting all Drive Files/Folders for <my actual email> on Shared Drive ID: <the actual folder ID>

User: <my actual email>, Shared Drive ID: <the actual folder ID>, Show Failed: Shared drive not found: <the actual folder ID>

Ross Scroggs

unread,
May 26, 2026, 4:40:09 PM (13 days ago) May 26
to google-ap...@googlegroups.com
Send me a private Meet/Zoom invitation and we'll investigate.

Ross
----
Ross Scroggs


Ross Scroggs

unread,
May 26, 2026, 5:19:00 PM (12 days ago) May 26
to google-ap...@googlegroups.com
Wrong: select teamdrive 1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv
Right: select 1me3cpVu6pYkVrC6QRp_RJ-7yCopenTPv

Ross
----
Ross Scroggs


Jason Wang

unread,
May 27, 2026, 9:56:34 AM (12 days ago) May 27
to GAM for Google Workspace
Same kickback, unfortunately. Based on the standard-out, it looks like the logic is looking for a Shared Drive that bears the ID I've passed in.

Getting all Drive Files/Folders for bob....@RedPublishing.com on Shared Drive ID: 1dd1cp...

User: bob....@RedPublishing.com, Shared Drive ID: 1dd1cp... , Show Failed: Shared drive not found: 1dd1cp...

Ross Scroggs

unread,
May 27, 2026, 10:39:00 AM (12 days ago) May 27
to google-ap...@googlegroups.com
My mistake, print|show filecounts select only works for Shared Drives.

Try the following: gam user bob....@RedPublishing.com print filelist select <FolderID> countsonly

Ross
----
Ross Scroggs


Jason Wang

unread,
May 29, 2026, 10:37:03 AM (10 days ago) May 29
to GAM for Google Workspace
Mr. Scroggs, we appear to be in business!

Getting all Drive Files/Folders that match query ('[ID of folder in question]
' in parents) for bob....@RedPublishing.com


Got 0 Drive Files/Folders that matched query ('[ID of last subfolder scanned, I suppose]' in parents) for bob....@RedPublishing.com...    


Owner,Total,application/drive-fs.osx.alias,application/illustrator,application/json,application/msword,application/octet-stream,application/pdf,application/postscript,application/vnd.google-apps.document,application/vnd.google-apps.folder,application/vnd.google-apps.form,application/vnd.google-apps.presentation,application/vnd.google-apps.shortcut,application/vnd.google-apps.spreadsheet,application/vnd.ms-excel,application/vnd.ms-excel.sheet.binary.macroenabled.12,application/vnd.ms-excel.sheet.macroenabled.12,application/vnd.ms-word.document.macroenabled.12,application/vnd.oasis.opendocument.spreadsheet,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.spreadsheetml.template,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.wordprocessingml.template,application/vns.ms-outlook,application/x-7z-compressed,application/x-compressed,application/x-iwork-keynote-sffkey,application/x-iwork-numbers-sffnumbers,application/x-ms-shortcut,application/x-zip,application/x-zip-compressed,application/xml,application/zip,audio/mpeg,image/bmp,image/gif,image/heif,image/jpeg,image/png,image/svg+xml,image/tiff,image/webp,image/x-photoshop,message/rfc822,text/css,text/csv,text/html,text/plain,text/rtf,text/x-url,text/xml,video/3gpp,video/mp4,video/quicktime

bob....@RedPublishing.com,363089,3,2,1,4766,302,137374,2,298,115925,10,18,22,365,7977,1,208,11,1,45,73025,6,5516,1,575,1,1,6,3,15,3,8,7,415,479,7,4,402,5072,4585,2,6,4,1,6,7,4742,54,724,10,2,42,1,18,8

<BREAK>

So there we have it! I imagine this tells us we have 363,089 total items, 3 of which are type osx.alias, 2 are application/illustrator, 1 is a .json, 4755 are msword files etc. Sound about right to you?

Ross Scroggs

unread,
May 29, 2026, 11:14:11 AM (10 days ago) May 29
to google-ap...@googlegroups.com
Looks good.

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.
Reply all
Reply to author
Forward
0 new messages