Query to identify users with otheremails defined

26 views
Skip to first unread message

David Tod

unread,
May 7, 2018, 11:06:02 AM5/7/18
to GAM for G Suite
I can set secondary emails e.g. 

gam update user us...@email.com otheremails work us...@work.com

...but is there a way to query and identify users who have had a secondary email set?

When I do a gam print users allfields (with a query), I notice that for those users who have one set, I get multiple emails fields, e.g.

emails.0.address,emails.0.type,emails.1.address,emails.1.primary

versus those without one set I get fewer fields

emails.0.address,emails.0.primary

I can query both primary and secondary emails, e.g. 

gam print users allfields query "email=us...@email.com"
and
gam print users allfields query "email=us...@work.com"

will both work producing the same record.

I can't query the domain because queries only do prefix matching, e.g. user* not *@work.com

Reply all
Reply to author
Forward
0 new messages