GAM Report for all users

1,220 views
Skip to first unread message

Edmond Ghazarian

unread,
Aug 7, 2019, 4:52:47 PM8/7/19
to GAM for G Suite
Hello everyone, 

Greatly appreciate your help. It's my first time using GAM and I'm unable to find any information here and the error I'm getting. 

I'm running the following command and below is the response. 

<gam all users report todrive>
Getting all Users in G Suite account (may take some time on a large account)...
Got 938 Users...
done getting 938 Users.

ERROR: report is not a valid argument for "gam"


What I'm trying to get out of this is the following per user
  1. Google Drive Item Count
  2. Google Drive Total Size
  3. Google GMail Mailbox Size.
Thanks

Ross Scroggs

unread,
Aug 7, 2019, 7:40:14 PM8/7/19
to google-ap...@googlegroups.com
Edmond,

The data you want is not trivially accessible, particularly the Drive Item Count.

gam report user fields "accounts:drive_used_quota_in_mb,accounts:gmail_used_quota_in_mb"


See: https://developers.google.com/admin-sdk/reports/v1/reference/usage-ref-appendix-a/users


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/ede71875-4d19-453d-974e-0ed82ea17474%40googlegroups.com.


--

Steve - DynTech

unread,
Aug 7, 2019, 10:40:56 PM8/7/19
to GAM for G Suite
not trivial, but very possible. perhaps a better way, here's what came to mind

Find all files across the domain returning minimal info
gam config auto_batch_min 1 num_threads 20 redirect csv ./all-domain-files.csv multiprocess all users print filelist showownedby me fields id

Count the files per person, sort by the most files to the least
csvcut -c 1 all-domain-files.csv | sort | uniq -c | sort -rn > counts-by-user.csv

Steve - DynTech

unread,
Aug 7, 2019, 10:58:23 PM8/7/19
to GAM for G Suite
If you have multiple millions of files you might want something faster. My time was done on a 131,722 row file

cat all-domain-files.csv | awk -F ',' '{cnts [$1] += 1 } END { for (v in cnts) print cnts[v], v }'

real    0m0.125s
user    0m0.108s
sys     0m0.046s

Compared to the previous command

real    0m0.752s
user    0m0.710s
sys     0m0.094s

Edmond Ghazarian

unread,
Aug 8, 2019, 11:12:41 AM8/8/19
to google-ap...@googlegroups.com
Thanks Ross, I tried your recommendation and the results were exactly what I needed. 

Steve - I'm going to try yours today and hopefully it gives the count I'm looking for. 

Greatly appreciate both of your help. 

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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