Finding users

1,385 views
Skip to first unread message

Gabriel Clifton

unread,
Sep 28, 2022, 1:23:33 PM9/28/22
to GAM for Google Workspace
How can I query all users with a regex or wildcard, like finding all users with an email address like X? So, find all users with an email address that contains "Ross" or "1234" in any part of the username, before the @.

Ross Scroggs

unread,
Sep 28, 2022, 1:29:31 PM9/28/22
to google-ap...@googlegroups.com
Gabriel,


$ gam print users query "givenName=Ross"

Getting all Users that match query (givenName=Ross), may take some time on a large Google Workspace Account...

Got 1 User: ross.s...@domain.com - ross.s...@domain.com

primaryEmail

ross.s...@domain.com


Ross


On Wed, Sep 28, 2022 at 10:23 AM 'Gabriel Clifton' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
How can I query all users with a regex or wildcard, like finding all users with an email address like X? So, find all users with an email address that contains "Ross" or "1234" in any part of the username, before the @.

--
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/e08bb574-5a5b-4a47-b415-edd99a8e6294n%40googlegroups.com.


--

Gabriel Clifton

unread,
Sep 28, 2022, 1:54:17 PM9/28/22
to google-ap...@googlegroups.com
Thanks, Ross, but I must be missing something. I want to contain Ross, not just =Ross. For example, I want to find emails like "ross.scroggs", "john.ross, and "scroggsross" I have tried *Ross*, *Ross, and Ross*, and I always get does not exist, or I don't get a full list when I know these accounts exist. In that link, I only see Ross*. Is it not possible to do this?




--

Gabriel Clifton | Network Administrator

Fort Stockton ISD | Technology Center

gabriel...@fsisd.net | http://www.fsisd.net

Office (432) 336-4055 Ext 2

Fax (432) 336-4050

1204 W. Second St., Fort Stockton, TX 79735


Please note: Although we sometimes respond to email, text, and phone calls instantly at all hours, our regular support hours are 8:00 AM - 5:00 PM, Monday through Friday.

We may need to wait until the next school day to address your issue. All issues are taken care of on a first-come, first-served basis, depending on severity, and problems with proper work orders submitted are handled first.


Confidentiality notice: The contents of this email message and any attachments are intended solely for the addressee(s), may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

Ross Scroggs

unread,
Sep 28, 2022, 2:06:37 PM9/28/22
to google-ap...@googlegroups.com
Gabriel,

Sorry, I misunderstood the question. The query won't do what you want, you'll have to have GAM do it for you.

$ gam config csv_output_row_filter "primaryEmail:regex:ross" print users primaryemail

Getting all Users, may take some time on a large Google Workspace Account...

Got 500 Users: aa...@domain.com - k1...@domain.com

Got 1000 Users: k5...@domain.com - tt...@domain.com

Got 1099 Users: uu...@domain.com - zz...@domain.com

primaryEmail

connor...@domain.com

pearl...@domain.com

ross.s...@domain.com


You'll still have to do additional filtering,


Ross




--

Gabriel Clifton

unread,
Sep 29, 2022, 9:05:26 AM9/29/22
to GAM for Google Workspace
Perfect as always. Thanks Ross.
Reply all
Reply to author
Forward
0 new messages