How to show how many mailboxes, used with each subdomain

439 views
Skip to first unread message

Shane Twentyman

unread,
Jul 27, 2018, 2:14:49 AM7/27/18
to GAM for G Suite
Hey guys, 

As in the subject, how do I see how many mailboxes for each subdomain?

thanks 

+KimNilsson

unread,
Jul 27, 2018, 5:54:53 AM7/27/18
to GAM for G Suite
If you don't want any magic, just push a file of all users to Drive and "count" them in Google Sheets.

gam print users todrive

Steve - DynTech

unread,
Jul 27, 2018, 6:05:29 AM7/27/18
to GAM for G Suite
gam print users query "orgUnitPath='/Org'" | grep -o 'domain\.com' | wc -l

Ross Scroggs

unread,
Jul 27, 2018, 8:20:23 AM7/27/18
to google-ap...@googlegroups.com
Steve,

gam print users query "orgUnitPath='/Org'" domain domain.com

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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/a54bcab1-70b2-4698-b98c-78ecf0fb9a1f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Larsen

unread,
Jul 27, 2018, 11:27:28 AM7/27/18
to Google Apps Manager
Very useful to know that can be added to limit the results.

In a way, I find using the grep seems nicer if you're just looking for the pure figure because you don't get all the user spat out on the screen and then have to scroll back up to see what GAM found in the results. It's also nice in that you see what GAM found for all users in that OU and the limited sub-set that you're looking for.

Many paths to the same destination :)

Screen Shot 2018-07-27 at 16.24.24.png


Steve Larsen

unread,
Jul 27, 2018, 11:53:51 AM7/27/18
to Google Apps Manager
Or if you have a bunch of domains and want to know how many of each all at once

gam print users query "orgUnitPath='/Operations'" | grep -EIho 'domain\.co\.uk|domain\.de' | sort | uniq -c

Steve Larsen

unread,
Jul 28, 2018, 6:10:04 AM7/28/18
to Google Apps Manager
Ross - I see you added some support for this in the lasted release :)

Ross Scroggs

unread,
Jul 28, 2018, 10:50:17 PM7/28/18
to google-ap...@googlegroups.com
Steve,


gam [<UserTypeEntity>] print users [todrive [<ToDriveAttributes>]]
        ([domain <DomainName>] [(query <QueryUser>)|(queries <QueryUserList>)] [deleted_only|only_deleted])|[select <UserTypeEntity>]
        [formatjson] [quotechar <Character>] [countonly]

gam print users countonly
gam org /Operations print users countonly

These write a CSV file:
domain,count
...

On Jul 28, 2018, at 3:09 AM, Steve Larsen <st...@dyntech.co.uk> wrote:

Ross - I see you added some support for this in the lasted release :)


On Fri, Jul 27, 2018 at 4:53 PM Steve Larsen <st...@dyntech.co.uk> wrote:
Or if you have a bunch of domains and want to know how many of each all at once

gam print users query "orgUnitPath='/Operations'" | grep -EIho 'domain\.co\.uk|domain\.de' | sort | uniq -c

On Fri, Jul 27, 2018 at 4:26 PM Steve Larsen <st...@dyntech.co.uk> wrote:
Very useful to know that can be added to limit the results.

In a way, I find using the grep seems nicer if you're just looking for the pure figure because you don't get all the user spat out on the screen and then have to scroll back up to see what GAM found in the results. It's also nice in that you see what GAM found for all users in that OU and the limited sub-set that you're looking for.

Many paths to the same destination :)

Shane Twentyman

unread,
Jul 29, 2018, 7:32:58 PM7/29/18
to GAM for G Suite
Thanks, that's exactly what I'm looking for!!

But I get this error 

ERROR: 400: Invalid Input: INVALID_OU_ID - invalid

Where have i gone wrong?
Steve,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

-- 
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-manager+unsub...@googlegroups.com.

-- 
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-manager+unsub...@googlegroups.com.

Shane Twentyman

unread,
Jul 29, 2018, 7:37:00 PM7/29/18
to GAM for G Suite
Right, didnt see the /operations

But trying the other command, gives me this 

ERROR: countonly is not a valid argument for "gam print users"

Kim Nilsson

unread,
Jul 29, 2018, 8:17:11 PM7/29/18
to Google Apps Manager
Are you using the most recent version of GAMADV-X? Not the regular GAM. 

Shane Twentyman

unread,
Jul 29, 2018, 8:24:25 PM7/29/18
to GAM for G Suite
Hey there, 

Thanks, 

I'm using whatever version this installs :)

bash <(curl -s -S -L https://git.io/install-gam)

I'm guessing the std version. 


So we have about 7 subdomains and I just wanted to see how many users had mailboxes with each one.

I would have thought it would be really simple lol 

Ross Scroggs

unread,
Jul 29, 2018, 8:40:48 PM7/29/18
to google-ap...@googlegroups.com
Shane,

That is an Advanced GAM command (https://github.com/taers232c/GAMADV-XTD)




Confidential communication: The information contained in this email (including any attachments) is confidential and may be subject to legal professional privilege. It is intended solely for the addressee. If you receive this email by mistake please promptly inform us by reply email and then delete the email and any attachments and destroy any printed copy. If you are not the intended recipient you are prohibited from disclosing or using in any way the information in this email or its attachments. There is no warranty that this email is error or virus free

--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
Reply all
Reply to author
Forward
0 new messages