Question

How do you quickly look up an exact username of a person in GAM?


Badge

Quick question to 0366f7b39b11255a.gif veterans: Since gam doesn't have autocomplete (or does it?) how do you quickly look up an exact username of a person you know the name of (like a quick search)
at the moment I use admin.google.com for that 🙈

I know there are many complex commands to search for users, but what is really the fastest way for the daily business?


10 replies

Userlevel 3
Badge +2

contacts.google.com works too


Open Thread in Slack
Userlevel 3
Badge +1

setting the domain in gam.cfg helps to shorten commands. haven't had the real need to look up a user. i usually just look up the first user on admin.google.com/ac/user or if i need to check a command.


Open Thread in Slack
Badge

yes, exactly but I am looking for an command line equivalent to that to avoid leaving the command line and opening the browser page


Open Thread in Slack
Badge

are there no real nerds here? 🤓


Open Thread in Slack
Userlevel 3
Badge +1

You would probably need to do something in bash to query against a CSV of all the users. Not sure how though.


Open Thread in Slack
Badge

I was playing around a bit more and I am having actually pretty decent results with

gam print users query Paul

by default it searches givenName, familyName, or email


Open Thread in Slack
Badge

I think I am happy with this solution. Please let me know if you have an even better version


Open Thread in Slack
Badge

more options: https://developers.google.com/admin-sdk/directory/v1/guides/search-users


Open Thread in Slack
Badge

more complex querys look like this:

gam info users query "givenName:*<Users First Name>*"

But I won't need them very often


Open Thread in Slack
Badge

Query is magic. In the browser Gmail works too, of course.


Open Thread in Slack

Reply