Clear contacts

70 views
Skip to first unread message

Gabriel Clifton

unread,
Oct 4, 2021, 10:38:49 AM10/4/21
to GAM for Google Workspace
I am trying to ensure our students do not have knowledge of certain staff email groups so I was going through and running gam ous_and_children "/campus/ student ou" clear contacts emailmatchpattern <group email address> and it was having trouble with the space in the student OU. Running the latest GAMADV version, am I doing something wrong with it? I am going to be running this command several times with different variations since our students should only be able to email their teacher so I want to ensure students do not have any unauthorized contacts due to bad misconfigurations of the past.

Gabriel Clifton

unread,
Oct 4, 2021, 10:46:12 AM10/4/21
to GAM for Google Workspace
Edit: I have also tried emailmatchpattern "*.@student.domain.com" and got ERROR: REPattern error: nothing to repeat at position 0  at the "*.@student.domain.com".

Ross Scroggs

unread,
Oct 4, 2021, 10:54:48 AM10/4/21
to google-ap...@googlegroups.com
Gabriel,

Since you said ous_and_children (a list) as opposed to ou_and_children (single item), you need special quoting:
gam ous_and_children "'/campus/ student ou'" clear contacts emailmatchpattern <group email address>   List
gam ou_and_children "/campus/ student ou" clear contacts emailmatchpattern <group email address>       Single item

You probably want delete instead of clear to simple delete the contact.

Edit: I have also tried emailmatchpattern "*.@student.domain.com" and got ERROR: REPattern error: nothing to repeat at position 0  at the "*.@student.domain.com".

Reverse the . and *
emailmatchpattern ".*@student.domain.com"

Ross

On Mon, Oct 4, 2021 at 7:38 AM 'Gabriel Clifton' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
I am trying to ensure our students do not have knowledge of certain staff email groups so I was going through and running gam ous_and_children "/campus/ student ou" clear contacts emailmatchpattern <group email address> and it was having trouble with the space in the student OU. Running the latest GAMADV version, am I doing something wrong with it? I am going to be running this command several times with different variations since our students should only be able to email their teacher so I want to ensure students do not have any unauthorized contacts due to bad misconfigurations of the past.

--
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/e63140b4-b7c9-4500-a0b1-a8ea217553aan%40googlegroups.com.


--

Gabriel Clifton

unread,
Oct 4, 2021, 11:58:09 AM10/4/21
to GAM for Google Workspace
When I tried "gam ou_and_children "/Campus/Student OU" clear contacts emailmatchpattern ".*@student.domain.com" I received this error on the 6th person and it stopped there. Switched to delete contacts and it worked fine.
Traceback (most recent call last):
  File "__init__.py", line 57977, in ProcessGAMCommand
  File "__init__.py", line 17152, in clearUserPeopleContacts
  File "__init__.py", line 17136, in _clearUpdatePeopleContacts
UnboundLocalError: local variable 'updatePersonFields' referenced before assignment

Brian Kim

unread,
Oct 4, 2021, 2:23:44 PM10/4/21
to GAM for Google Workspace
Are you using Contacts API? (6.07.xx or older) or People API? (6.08.xx or later)

Ross Scroggs

unread,
Oct 4, 2021, 2:49:57 PM10/4/21
to google-ap...@googlegroups.com
It was a bug, fixed in 6.08.10

Ross



--
Reply all
Reply to author
Forward
0 new messages