Deleting Incorrect User Contacts

136 views
Skip to first unread message

Jeff Strickler

unread,
Aug 9, 2024, 4:40:22 PM8/9/24
to GAM for Google Workspace
I'm trying to find the best way to delete contacts after a username change occurs.

I can run these two commands:

gam ou_and_children_ns <OU> delete othercontacts emailmatchpattern “h...@domain.org"

gam ou_and_children_ns <OU> delete contacts emailmatchpattern h...@domain.org"

These take a long time and we need to run this for several people that have had username changes. Is there a way to include multiple contacts to delete in these two scripts? Let's call that question 1.

Question 2: Is this a better idea, and if not what is best practice? Since we allow staff to see all staff in our directory should we just delete every saved contact with our domain (@domain.org)?  AND change the mail setting to NOT autosave contacts. This way they will always pull from the list in our domain and won't be email contacts that don't exist. If this is a recommended solution is there a script where I could find any contact ending in our domain (...@domain.org) and delete them?

Ian Crew

unread,
Aug 9, 2024, 7:52:29 PM8/9/24
to google-ap...@googlegroups.com
Yes, it's pretty broken in Google's implementation of things. 

There really isn't a great way to clean things up, and using GAM to edit a user's personal contacts is reasonably invasive privacy-wise. (For example, maybe I have a contact called "Boss", with some additional details about my boss like his family's birthdays or his home address. I might be kind of annoyed if that contact got deleted, even if he did change his email address.)

See below for a a thing I wrote up a year or so ago about people changing their lived name, and how this brokenness in Google is problematic. It also illustrates the overall problem pretty well.

Hope that helps, at least a little,

Ian

=================================================


The following setting in Gmail is on-by-default (it’s in Settings > General):

PastedGraphic-1.png

That feature is really pretty handy, for lots of reasons, and turning it off would have some pretty negative impacts to the usability of Workspace.

BUT there’s a serious bug in that feature. The auto-saved contacts in “Other Contacts” override the local Google Workspace directory.

That means that for people who change their lived name, anyone who ever sent an email to them before they changed their lived name will continue to have Gmail autocomplete the dead name, even if the person has properly updated their lived name in the Workspace directory.

This is a very subtle wrinkle of this feature, and I’m sure an unintended consequence, but it is leading to a fair bit of hurt, and therefore angry tickets, for us.

Due to the nature of the feature, it’s also incredibly unclear to either the email sender or recipient as to why it’s happening, which amplifies the hurt. (It took me half an hour just to explain it to my team, much less anyone else!)

A good potential fix would be to make the person metadata (name, department, address, etc.) for Other Contacts from within the same Workspace instance stay in sync with the directory rather than being a point-in-time capture.

Or maybe to make it so that Other Contacts aren't added at all for addresses within the same Workspace instance.

Or maybe change the current hierarchy of lookups for address autocompletes from the current ordering:

1) My Contacts (the ones I’ve explicitly saved/edited)
2) Other Contacts (the ones auto saved by the feature above)
3) Google Workspace directory

to:

1) My Contacts (the ones I’ve explicitly saved/edited)
2) Google Workspace directory
3) Other Contacts (the ones auto saved by the feature above)




--
Ian Crew

Architect, Communication and Collaboration Services
Productivity & Collaboration Services
Berkeley IT
University of California, Berkeley


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/f6c5a602-cf01-4dc7-8d4d-02f57d533c74n%40googlegroups.com.
PastedGraphic-1.png
Message has been deleted

Jeff Strickler

unread,
Aug 15, 2024, 1:51:08 PM8/15/24
to GAM for Google Workspace
Thanks Ian. I think Google should sync personal contact metadata with the data in the domain so it can't go out of date. I feel that would make the most sense as it could be done on the fly when the data is changed. 

Unfortunately, that is not in place so I'm wondering what my best option is now. Do you know if those commands are it? If I want to clear old email addresses and I want to run it through all our users (over 13,000) that takes a significant amount of time. It runs through every user's contacts one at a time. It checks if there is a match, and then moves on to the next user. 

Since we have several email addresses we would like to delete in one shot (so it only has to process each person's contacts once) I'm wondering if anyone knows if this can be done, and if so what would the command look like?
Reply all
Reply to author
Forward
0 new messages