Print/Add/Delete contacts that match query - Need Help

297 views
Skip to first unread message

M Watson

unread,
Nov 9, 2017, 8:26:19 AM11/9/17
to GAM for G Suite
Good morning. I'm trying to get comfortable with GAMADV-X's User Contacts commands and am having issues getting it to work properly, specifically with the query argument.

Goal: To delete all contacts from a user's contacts that begin with Name(or givenName) "BRG"
(These are old distribution groups no longer used, but still persisting in our user's contacts.)

To avoid a catastrophe I attempted to print the results first, but I can't find where I'm messing things up. All of the commands seen below return:
"Getting all Contacts that match query (givenName=BRG)" (query possibly different based on what I tried)
"Got - Contacts..."
"User,ContactID,Name"

Commands I've tried:
gam user mwa...@brgroup.com print contacts query givenName="BRG*" (asterisk inside or outside the quotes)
gam user mwa...@brgroup.com print contacts query givenName:"BRG*" (asterisk inside or outside the quotes)
gam user mwa...@brgroup.com print contacts query givenName=BRG* (no quotes)
I've also tried it w/ 'Name=' to no avail.

Ross Scroggs

unread,
Nov 9, 2017, 8:49:02 AM11/9/17
to google-ap...@googlegroups.com
M,


Fulltext query on contacts data fields. The API currently supports simple search queries such as q=term1 term2 term3
and exact search queries such as q="term1 term2 term3"

It looks like the best you can do is:
gam user mwa...@brgroup.com print contacts query "BRG"

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/c72f7a63-45bc-4ae8-9428-71c4c7111755%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M Watson

unread,
Nov 9, 2017, 10:23:14 AM11/9/17
to GAM for G Suite
Got it, thanks! I was looking at the wrong documentation apparently... That gets me enough data to get the job done.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages