[GAMADV] Having trouble modifying user contacts

712 views
Skip to first unread message

Matt Watson

unread,
Feb 15, 2018, 9:01:42 AM2/15/18
to GAM for G Suite
I'm not having any luck utilizing GAMADV to update some user's contact info

We have ~200 users many of which have been here for quite a while so there is a lot of outdated contact info. A particular example, one user has had email accounts for three separate domains so depending on the sender, an email can have three different "to" addresses. When he does a ReplyAll, the email chain will now contains the old alias AND his new address. Let's say I want to edit my contacts and update the email for jo...@OLDcompany.com to jo...@NEWcompany.com... The error statements seem to guide me in circles.

gam user ma...@NEWcompany.com update contacts query jo...@OLDcompany.com email work jo...@NEWcompany.com primary      
is just one of my shots in the dark at this that throws an error

Thanks for your help!

Ross Scroggs

unread,
Feb 15, 2018, 9:29:18 AM2/15/18
to google-ap...@googlegroups.com
Matt,

This is probably what you're seeing:
$ gam user ma...@NEWcompany.com update contacts query jo...@OLDcompany.com email work jo...@NEWcompany.com primary   
Command: /Users/Ross/Documents/GoogleApps/GAM/gamadvx.py user ma...@NEWcompany.com update contacts query >>>jo...@OLDcompany.com<<< email work jo...@NEWcompany.com primary

ERROR: Invalid argument: Expected <additionalname|address|addresses|billinginfo|birthday|calendar|calendars|contactgroup|contactgroups|directoryserver|email|emails|event|events|externalid|externalids|familyname|firstname|gender|givenname|hobbies|hobby|im|ims|initials|jot|jots|language|lastname|location|maidenname|middlename|mileage|name|nickname|note|notes|occupation|organization|organizations|phone|phones|prefix|priority|relation|relations|sensitivity|shortname|subject|suffix|updated|userdefinedfield|userdefinedfields|website|websites>
Help: Syntax in file /Users/Ross/Documents/GoogleApps/GAM/GamCommands.txt

gam <UserTypeEntity> update contacts <ContactEntity> [contactgroup <ContactGroupItem>] <ContactAttributes>+
gam <UserTypeEntity> delete contacts <ContactEntity>|([query <QueryContact>] [contactgroup <ContactGroupItem>] [emailmatchpattern <RegularExpression>] [emailmatchtype work|home|other|<String>] [updated_min <Date>])

query is not supported for update contacts.

You could do:
gam user ma...@NEWcompany.com print contacts query jo...@OLDcompany.com
Extract the ContactID
gam user ma...@NEWcompany.com update contacts <Put ContactID Here> email work jo...@NEWcompany.com primary 

But that would get old fast; I'll look into adding query to update.

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/08b18bc3-217b-4d73-bf78-635bf14e00aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ross Scroggs

unread,
Feb 15, 2018, 3:33:53 PM2/15/18
to google-ap...@googlegroups.com
Matt,

I've implemented the change to let you do your contact cleanup.

This will now work:
$ gam user ma...@NEWcompany.com update contacts query jo...@OLDcompany.com email work jo...@NEWcompany.com primary   

Ross



To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.




--

Matt Watson

unread,
Feb 15, 2018, 5:25:06 PM2/15/18
to GAM for G Suite
I'm speechless... You made that too easy. 

It works flawlessly - Thank you!
To post to this group, send email to google-ap...@googlegroups.com.




--

David Hurst

unread,
Mar 7, 2019, 5:29:02 PM3/7/19
to GAM for G Suite
Hi

I am also having issues updating contacts , namely updating their inclusion in contact groups. It appears as though it works but in checking contacts UI no change has actually been made ?? I have tried using contactgroup id and name with the same result for each:
 
gam user targe...@email.com update contacts query contact...@email.com contactgroup id:sdjklfe87348fdjh
Got 1 Contacts...
User: targe...@email.com , Update maximum of 1 Contacts
  User: targe...@email.com, Contact: b87b3fy7988c66f, Updated (1/1)

Help appreciated

Thanks David

Ross Scroggs

unread,
Mar 7, 2019, 6:02:34 PM3/7/19
to google-ap...@googlegroups.com
David,

What does this show: gam user targe...@email.com info contact b87b3fy7988c66f fields name,contactgroup

Ross

This message, and any attachments are intended only for the addressee(s) listed and contain privileged or confidential information. If you receive this message in error, please notify the sender immediately and delete the message. You understand that any privilege or confidentiality attached to this message is not waived, lost or destroyed because you have received this message in error. Opinions contained in the message(s) do not necessarily reflect the opinions of Catholic Education, Diocese of Cairns. Whilst all care has been taken, Catholic Education, Diocese of Cairns disclaims all liability for loss or damage to person or property arising from this message being infected by computer virus or other contamination.

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

For more options, visit https://groups.google.com/d/optout.


--

Ross Scroggs

unread,
Mar 7, 2019, 11:15:33 PM3/7/19
to google-ap...@googlegroups.com
David,

A documentation issue, contactgroup is used in two contexts, limiting a query to a particular contact group and as a value that can be changed.
Change the command slightly: gam user targe...@email.com update contacts query contact...@email.com endquery contactgroup id:sdjklfe87348fdjh

Reply all
Reply to author
Forward
0 new messages