gam group sync but skip certain members

162 views
Skip to first unread message

Dennis M

unread,
Sep 22, 2022, 9:53:46 AM9/22/22
to GAM for Google Workspace
Hey all!

I sync groups and grep or grep exclude OUs depending on what I want. But the primary goal of this post is asking if I know there are certain members that I want to keep that are not the right OU, in a primary case they are groups so there is no ou. Is there a streamlined way to do this?

gam print users fields primaryemail,ou | grep "/US/" > AllUS.csv
gam update group us@ sync member csvfile AllUS.csv:primaryEmail

but i would like group usxx@ and usyy@ to still be members. 

My thought to make this work, since i do this in a script already is to append the groups to the csv before the sync.

Thanks!

Ross Scroggs

unread,
Sep 22, 2022, 11:11:34 AM9/22/22
to google-ap...@googlegroups.com
Dennis,


Try this:
gam update group us@ sync member usersonly csvfile AllUS.csv:primaryEmail

Ross

This message contains information which may be confidential and/or protected by attorney-client privilege.  Unless you are the addressee, you may not use, copy or disclose to anyone this message or any information contained in this message.  If you have received this message in error, please send me an email and delete this message.   Thank you.

--
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/d99a5853-6c2d-466d-8ece-0c4cc8b000aan%40googlegroups.com.


--

Dennis M

unread,
Sep 22, 2022, 12:11:38 PM9/22/22
to GAM for Google Workspace
Ross this is awesome! Thank you.

This solve 99% of my need.  

For the one other case where i have an odd ball user that needs to be an a group that they probably shouldn't be.. im just adding them to the csv with sed, not pretty but works.

Thanks again
Reply all
Reply to author
Forward
0 new messages