Remove user from group using regex match?

24 views
Skip to first unread message

Scott Ezell

unread,
Jan 5, 2023, 12:39:17 PM1/5/23
to GAM for Google Workspace
I've been working on automating student accounts. I have creation and suspension working, but transfers between our schools has me stuck. I need to remove them from one school's student group and add them to another. 

I process all students every day, and add them to the correct group. If they haven't moved, no big deal, it just attempts to re-add them to the group they're already in.

But if they have moved, then they get added to the correct group, but they're still left in the incorrect group. What I'm looking for is a way I can remove a group from a user using a pattern, rather than a specific group name.

Our student groups follow this format:  AA.gra...@students.domain.org

AA is school abbreviation, and is always two letters
BBBB is the grade number 1-12, K, PreK, or PreS

I'm thinking I might be able to do something with 'csv_out_row_filter' but I can't figure out the syntax.

Ross Scroggs

unread,
Jan 5, 2023, 12:56:58 PM1/5/23
to google-ap...@googlegroups.com
Scott,

Send me a Meet/Zoom invitation and we'll discuss.

Ross
----
Ross Scroggs



--
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/9921af0d-5858-46d9-8bbf-2ceb0950f40bn%40googlegroups.com.

Ross Scroggs

unread,
Jan 5, 2023, 4:23:55 PM1/5/23
to google-ap...@googlegroups.com
Scott,

With Advanced GAM 6.30.11 you can do:
gam user us...@domain.com delete groups emailmatchpattern "XY.*"

Ross
----
Ross Scroggs


On Jan 5, 2023, at 9:39 AM, Scott Ezell <scott...@lcschools.org> wrote:

Scott Ezell

unread,
Jan 5, 2023, 5:04:12 PM1/5/23
to GAM for Google Workspace
Sorry for the delay in getting back to you. I just tested this out, and it looks good to me!

I really appreciate it.
Reply all
Reply to author
Forward
0 new messages