gam print users query syntax

13,113 views
Skip to first unread message

AlCrosby

unread,
Aug 22, 2013, 6:20:20 PM8/22/13
to google-ap...@googlegroups.com
Is there a reference for the query parameter on the print users command?

The only query that I've stumbled upon working (and it's useful) is "email:ad*" to find all email addresses that start with ad.

Surely there's more tags that work, and may be a single char match wildcard...

Thanks!

Albert

Jay Lee

unread,
Aug 26, 2013, 11:17:41 AM8/26/13
to google-ap...@googlegroups.com
From the API docs at:


Query string for prefix matching searches. Should be of the form "key":"value*" where key can be "email", "givenName" or"familyName". The asterisk is required, for example: "givenName:Ann*" is a valid query.

Hope this helps. I have encouraged Google to expand the possible query parameters. "OU:Whatever" is a very needed addition.

Jay

Lance Pearce

unread,
Aug 27, 2013, 4:14:51 PM8/27/13
to google-ap...@googlegroups.com
Should suspended status work ? 
IE: gam print users allfields query "suspended:false" > users.csv

Karin Swanson

unread,
Jun 8, 2016, 4:19:30 PM6/8/16
to Google Apps Manager
I was able to query on suspended status using:

gam print users allfields query "isSuspended=true" > users.csv

Shruthi Kaushik

unread,
Dec 7, 2018, 7:43:37 AM12/7/18
to GAM for G Suite
How to get the status of specific user whether suspended or not?

Ross Scroggs

unread,
Dec 7, 2018, 8:51:14 AM12/7/18
to google-ap...@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-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/1bfc3e84-5f8b-4af0-822a-c8914479446a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shruthi Kaushik

unread,
Dec 7, 2018, 9:48:02 AM12/7/18
to GAM for G Suite
But this gives all the values but is there a way where i can fetch one single column like suspended or not.


On Friday, December 7, 2018 at 7:21:14 PM UTC+5:30, Ross Scroggs wrote:
On Dec 7, 2018, at 4:43 AM, Shruthi Kaushik <saishr...@gmail.com> wrote:

How to get the status of specific user whether suspended or not?

On Thursday, June 9, 2016 at 1:49:30 AM UTC+5:30, Karin Swanson wrote:
I was able to query on suspended status using:

gam print users allfields query "isSuspended=true" > users.csv

On Tuesday, August 27, 2013 at 3:14:51 PM UTC-5, Lance Pearce wrote:
Should suspended status work ? 
IE: gam print users allfields query "suspended:false" > users.csv

On Monday, August 26, 2013 11:17:41 AM UTC-4, Jay Lee wrote:
From the API docs at:


Query string for prefix matching searches. Should be of the form "key":"value*" where key can be "email", "givenName" or"familyName". The asterisk is required, for example: "givenName:Ann*" is a valid query.

Hope this helps. I have encouraged Google to expand the possible query parameters. "OU:Whatever" is a very needed addition.

Jay

--
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.

+KimNilsson

unread,
Dec 8, 2018, 2:06:35 PM12/8/18
to GAM for G Suite
gam user userATdomain print users todrive fields suspended

Shruthi Kaushik

unread,
Dec 13, 2018, 4:01:19 AM12/13/18
to GAM for G Suite
Thanks Kim. Could you please clarify me "todrive fields". Is that the below syntax to know whether user account is suspended or not.

Could you please help me with some examples.

Kim Nilsson

unread,
Dec 13, 2018, 9:06:44 AM12/13/18
to Google Apps Manager
Yes!

todrive - will create a Google Sheets file in your Drive with the result.

fields suspended - will give users status in a column in the Sheets file.

/Kim
--
There is No Substitute!

Eric Dannewitz

unread,
Dec 13, 2018, 9:10:11 AM12/13/18
to google-ap...@googlegroups.com
Have you check the wiki for gam? Plenty of examples there. Or searched the archives on this google group?

Eric Dannewitz 
Technology Assistant
Acalanes Union High School District
District Office Technology Department


--
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.

JS

unread,
Mar 30, 2023, 12:34:46 PM3/30/23
to GAM for Google Workspace
What would be the syntax to add multiple key:value queries? More specifically, how would I use this command to print info for a few different specific email addresses?

Ross Scroggs

unread,
Mar 30, 2023, 12:58:24 PM3/30/23
to google-ap...@googlegroups.com

gam print users queries "email=test...@domain.com","email=test...@domain.com" fields primaryemail,name


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.


--

JS

unread,
Mar 30, 2023, 1:03:06 PM3/30/23
to GAM for Google Workspace
Thank you!
Reply all
Reply to author
Forward
0 new messages