Batch printing filecount to csv

221 views
Skip to first unread message

AKC

unread,
Mar 4, 2022, 12:28:21 PM3/4/22
to GAM for Google Workspace
Hello! I'm trying print the file counts of all our users, while excluding a couple user who seem to be hanging up the process. I've gotten as far as getting gam user [email] print filecounts >./Documents/Sheets/sheet2.csv for each user into a .txt file from excel, with a plan of combining all the resulting csv files later. However, when I run gam batch ./Documents/Sheets/gambatchtest.txt I get the following: ERROR: Invalid argument
Help: Syntax in file /Users/mydrive/bin/gamadv-xtd3/GamCommands.txt

Can anyone help me figure out where I'm going wrong?  Perhaps I'm conflating the GAM and GAMADV capabilities? Thanks in advance for any guidance!

Ross Scroggs

unread,
Mar 4, 2022, 12:33:11 PM3/4/22
to google-ap...@googlegroups.com
AKC,

Advanced GAM:
Assuning a CSV file ListOfUsers.csv with header User:
gam redirect csv ./Documents/Sheets/sheet2.csv multiprocess csv ListOfUsers.csv gam user "~User" print filecounts

--
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/60cd06ad-6907-45ff-98fb-7b29828ebe38n%40googlegroups.com.

AKC

unread,
Mar 4, 2022, 12:39:57 PM3/4/22
to GAM for Google Workspace

Thanks so much, Ross! Incredible help as always. One follow-up -- Is this spitting the output of each user into a singular file (ListofUsers.csv), or just printing it to the screen? Running the initial gam command, one annoying problem I was running into is that it would spit out a new file for each entry, so I also needed to increment the sheet names so that each command wouldn't overwrite the output of the one preceding it (hence sheet 1, sheet 2, etc). 

Ross Scroggs

unread,
Mar 4, 2022, 12:50:13 PM3/4/22
to google-ap...@googlegroups.com
The command is reading ListOfUsers.csv to get the users of interest, all output is written to sheet2.csv

This requires Advanced GAM.

Contact me directly via Meet/Zoom if you have further questions.

AKC

unread,
Mar 4, 2022, 1:31:03 PM3/4/22
to GAM for Google Workspace
Thanks very much, I think this is going to work perfectly. 
Reply all
Reply to author
Forward
0 new messages