Populating My Contacts from Directory Contacts Data

221 views
Skip to first unread message

Steve - DynTech

unread,
Jun 26, 2019, 8:13:54 AM6/26/19
to GAM for G Suite
Is there a gam command that can do this? Take all the Directory contacts and that info and move this to the users My Contacts.

I know what when I simply do it via the gui the additional info does copy across, just first name, lastname, email. I'd like to at least copy over all the phone numbers so that when an incoming call happens users can see the name of the person calling.

Steve - DynTech

unread,
Jun 26, 2019, 9:53:07 AM6/26/19
to GAM for G Suite

Steve - DynTech

unread,
Jun 26, 2019, 12:13:41 PM6/26/19
to GAM for G Suite
And here's the command. It will error out on some unicode characters though like the EN DASH' (U+2013) for example but mostly works for this purpose.

gam print gal formatjson quotechar "'" | gam csv - quotechar "'" gam user steve create contacts json ~JSON contactgroup "System Group: My Contacts"

If you want to look at the data before importing
gam print gal formatjson quotechar "'" > allusers.json

Mike Beane

unread,
Jun 27, 2019, 7:29:10 AM6/27/19
to google-ap...@googlegroups.com
I ran across this last year in relation to a unicode issue, which tends to be like kryptonite at times, disregard if unrelated.


+KimNilsson

unread,
Jun 27, 2019, 2:59:47 PM6/27/19
to GAM for G Suite
Wow, that'd be a lot of contacts in a large organisation.
Populating the user's My Contacts would be synced to the user's phone (which is the point if I'm reading this right).
Could potentially "blow up" someone's phone. :-)

Well, I still do this manually on every incoming call, adding them as contacts, which perhaps I wouldn't have to if I did this.

Feels like I'd like to skip all students, though.
And, I'd still not get phone numbers of desk phones in classrooms, and staff areas, as they are not users in the GAL.

For private callers I use the Truecaller mobile app, that does automatic lookups during the incoming call. Also lets me auto-block spammers/telemarketers.
Reply all
Reply to author
Forward
0 new messages