Remove contacts in personal contacts of users.

54 views
Skip to first unread message

Jasper Cuvelier

unread,
Dec 13, 2017, 2:50:51 AM12/13/17
to GAM for G Suite
Hi!

Long story short:
Whenever there are internal shifts in our schools, we end up with people having multiple accounts. (for example: a teacher becomes a principal ==> tea...@school1.com becomes prin...@school2.com and so on)
I usualy remove the teacher-account.
The directory is updated almost instantly, so that is not an issue. However when you type in the first name of that teacher, both the directory contacts and the personal contacts are pulled up.
In users personal contacts, the old (unexisting) account (tea...@school1.com) is still there. 

What I need is a script (or some guidance to create a script like that) or a GAM/GAM ADVANCED command that I can use to access users personal contacts and clean out the old "tea...@school1.com" accounts in batch...

Anyone?


Michel Fasen

unread,
Dec 14, 2017, 7:07:13 AM12/14/17
to GAM for G Suite
I use Ross's GAM and this version has the ability to manage local contacts: https://github.com/taers232c/GAMADV-X/wiki/Users---Contacts

You can search on particular email addresses using the emailmatchpattern parameter:

gam user <email> print contacts emailmatchpattern ".*@<domain>" fields email 
 
Michel

+KimNilsson

unread,
Dec 15, 2017, 10:13:11 AM12/15/17
to GAM for G Suite
And, if you want it all in one csv you can redirect it (with GAMADV-X).

gam redirect csv ./oldfoocontacts.csv all users print contacts emailmatchpattern ".*@domain" fields email

Do note, however, that it quickly amasses to a lot of data!
Users often have 1000s of contacts!
Reply all
Reply to author
Forward
0 new messages