incorrect results for "gam report allusers fields accounts:total_quota_in_mb,accounts"

470 views
Skip to first unread message

Craig D Rice

unread,
Sep 28, 2022, 12:39:09 PM9/28/22
to GAM for Google Workspace
Using the most recent version of gam (gamadv-xtd3-6.27.05), I run:

gam report users fields accounts:total_quota_in_mb,accounts:used_quota_in_mb

The accounts:total_quota_in_mb field returns -1 instead of the user's quota. For example:

c...@stolaf.edu,2022-09-26,-1,38930

I have verified that the user "cdr" does have a quota.

The results are consistent with gam report calling customerUsageReports.get() instead of userUsageReport.get().

https://developers.google.com/admin-sdk/reports/v1/appendix/usage/customer/accounts references CustomerUsageReports.get() with "total_quota_in_mb    integer    Total storage quota (in MB) for the domain. A negative value is returned for customers that have enrolled in G Suite Business."

The report I am seeking is the quota for the user, which is documented here:

https://developers.google.com/admin-sdk/reports/v1/appendix/usage/user/accounts references UserUsageReport.get() with "total_quota_in_mb    integer    The total storage (in MB) for the user."

I have tried variations of gam report with parameters instead, and it yields the same result.

Any ideas?

Thanks for you help,
Craig


Ross Scroggs

unread,
Sep 28, 2022, 1:21:46 PM9/28/22
to google-ap...@googlegroups.com
Craig,

Send me a Meet/Zoom invitation to discuss.

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/598c0b2b-ea38-4cd7-ae41-5966a6e24de5n%40googlegroups.com.


--

Ross Scroggs

unread,
Sep 28, 2022, 1:43:06 PM9/28/22
to google-ap...@googlegroups.com
Craig,

Gam is calling the correct API; it reports what Google returns.

$ gam report users fields accounts:total_quota_in_mb,accounts:used_quota_in_mb

Getting Reports for all users

Got 13 Reports for all users on 2022-09-26...

email,date,accounts:total_quota_in_mb,accounts:used_quota_in_mb

ad...@domain.com,2022-09-26,-1,563

ch...@domain.com,2022-09-26,-1,0

c...@domain.com,2022-09-26,15360,0

drives...@clouddevices.us,2022-09-26,15360,0

gro...@domain.com,2022-09-26,15360,0

mail...@domain.com,2022-09-26,-1,0

ro...@domain.com,2022-09-26,-1,0

ross...@domain.com,2022-09-26,15360,0

souv...@domain.com,2022-09-26,15360,0

test...@domain.com,2022-09-26,15360,0

test...@domain.com,2022-09-26,15360,0

test...@domain.com,2022-09-26,15360,0

test...@domain.com,2022-09-26,15360,0


$ gam report customer services accounts fields accounts:total_quota_in_mb,accounts:used_quota_in_mb

date,name,value

2022-09-26,accounts:total_quota_in_mb,138236

2022-09-26,accounts:used_quota_in_mb,563


Ross


On Wed, Sep 28, 2022 at 10:00 AM 'Craig D Rice' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
--
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/598c0b2b-ea38-4cd7-ae41-5966a6e24de5n%40googlegroups.com.


--

Craig D Rice

unread,
Sep 28, 2022, 3:23:34 PM9/28/22
to google-ap...@googlegroups.com
Ross,

The output of your first command is helpful; it does show that Google can report user quotas. Below is our output of the same command.

[root@ola gamadv-xtd3-6.27.05]# ./gam report users fields accounts:total_quota_in_mb,accounts:used_quota_in_mb | egrep -i '^(email|cdr@)'

Getting Reports for all users
Got 13607 Reports for all users on 2022-09-26...
email,date,accounts:total_quota_in_mb,accounts:used_quota_in_mb
c...@stolaf.edu,2022-09-26,-1,38930

Here is confirmation that a quota is set for user "cdr":

image.png

The quota is applied via a group.

image.png

And "cdr" is a member of the "npatesting" group. The group membership and the group quota have been in place for many days, so it is not a timing issue.

[root@ola gamadv-xtd3-6.27.05]# ./gam info group npatesting | grep cdr
    member: c...@stolaf.edu (user)


Just out of curiosity, are you applying quotas by ou or by group? 

Craig



--

Craig D. Rice
Director of Enterprise Infrastructure | IT
St. Olaf College
1510 St. Olaf Avenue Northfield, MN 55057-1097  USA
(he, him, his)

Ross Scroggs

unread,
Sep 28, 2022, 3:35:08 PM9/28/22
to google-ap...@googlegroups.com
Craig,

Gam is simply reporting the data Google supplies; there is no manipulating of the data by GAM.

Send me a Meet/Zoom invitation.

Ross



--

Ross Scroggs

unread,
Sep 28, 2022, 3:58:01 PM9/28/22
to google-ap...@googlegroups.com
Craig,

Put c...@stolaf.edu in userKey
Put 2022-09-26 in date
Put your customer ID (get from gam info domain) in customerId
Put accounts:total_quota_in_mb,accounts:used_quota_in_mb in parameters
Click execute

Ross

--

Steve Zinski

unread,
Oct 17, 2022, 6:30:42 PM10/17/22
to GAM for Google Workspace
Any update on this? I too need the total_quota_in_mb to be the actual quota (I'm seeing -1 too). In the process of writing a script to send email notifications to anyone over quota and won't know if they're over quota unless I know their quota and usage. Thanks.

Craig D Rice

unread,
Oct 18, 2022, 10:43:27 AM10/18/22
to google-ap...@googlegroups.com
Steve,

We did some troubleshooting on this with Ross.

Our collective best guess is that, even though we are applying quotas to users via groups and ous, because Google has not yet turned on its high-level quota for our domain, we imagine that Google is simply not calculating accounts:total_quota_in_mb or accounts:used_quota_in_percentage. We verified that gam is correctly returning the values from the API. For reporting purposes, I wound up comparing accounts:used_quota_in_mb with the quota assigned to the user's google-storage-XXg-quota Google Security Group.

In our implementation process, I created the following four scripts:
  • google-assign-quotas - assigns users to google groups such that every user is in a group quota bucket for which they are no more than 80% of their quota - helpful for initially assigning quotas
  • google-change-quota - generates gam commands and admin.google.com instructions for updating a user's quota - some steps have to be performed interactively in the admin.google.com, so it cannot be fully automated 
  • google-report-quotas -w X - reports users at X percent of their quota utilization
  • google-summarize-quotas - shows a list of our quota buckets and the number of users/percentage of users who are in them
Happy to share if anyone is interested.

Craig

Steve Zinski

unread,
Oct 18, 2022, 11:10:52 AM10/18/22
to GAM for Google Workspace
Thanks, Craig. What's interesting is that the quotas (and percentages) do show up in our Google Admin GUI (see attached).
Screen Shot 2022-10-18 at 11.06.18 AM.png

Ian Crew

unread,
Oct 18, 2022, 11:16:40 AM10/18/22
to google-ap...@googlegroups.com
Given what Craig is saying about the root of this being incorrect data coming out of Google’s APIs, it seems to me that raising it as a bug with Google support might be the logical next step here. 

If you do, don’t let them get away with claiming that fixing this bug is a feature idea and sending you to the feature ideas section of GCC. The support team at Google does have the able to submit proper bugs to the development team, though they are often quite reluctant to do so and need real (but polite, of course) persistence and encouragement to actually do so. 

Cheers,

Ian

--
Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Ian Crew

unread,
Jan 12, 2024, 5:59:37 PM1/12/24
to google-ap...@googlegroups.com
Hi all:

Reviving a bit of a zombie thread, but I’m seeing the same “-1” reporting for accounts:total_quota_in_mb when I try it today (Jan 2024). Was anyone ever able to figure out how to get GAM to accurately report what each user’s quota is actually set to?

Thanks,

Ian

On Oct 18, 2022, at 8:16 AM, Ian Crew <ic...@berkeley.edu> wrote:

Given what Craig is saying about the root of this being incorrect data coming out of Google’s APIs, it seems to me that raising it as a bug with Google support might be the logical next step here. 

If you do, don’t let them get away with claiming that fixing this bug is a feature idea and sending you to the feature ideas section of GCC. The support team at Google does have the able to submit proper bugs to the development team, though they are often quite reluctant to do so and need real (but polite, of course) persistence and encouragement to actually do so. 

Cheers,

Ian
On Tue, Oct 18, 2022 at 8:11 AM Steve Zinski <szi...@gmail.com> wrote:
Thanks, Craig. What's interesting is that the quotas (and percentages) do show up in our Google Admin GUI (see attached).

Antonio Casado

unread,
Feb 13, 2025, 2:24:27 PM2/13/25
to GAM for Google Workspace
Hi all,

say

total_quota_in_mb  
integer  Total storage quota (in MB) for the domain. A negative value is returned for customers that have enrolled in G Suite Business.

Bye

Robert Robinson

unread,
Jun 3, 2025, 4:43:40 AM6/3/25
to GAM for Google Workspace

We are also seeing this issue as Google Education but ours returns 68087 for all users.
Reply all
Reply to author
Forward
0 new messages