updating existing groups

169 views
Skip to first unread message

M Anon

unread,
Aug 18, 2021, 6:45:07 PM8/18/21
to GAM for Google Workspace
Hi,

We generate a CSV that lists the student's email and the groups they belong to. We want to use it to:

1. Create the group if it doesn't exist
2. Update the group membership to contain only the students in the current CSV

We achieve the 1st part via "gam csv filename.csv gam create group ~GROUP" which just errors out if the group already exists. The 2nd part is trickier:

gam csv filename.csv gam update group ~GROUP_EMAIL remove all users
gam csv filename.csv gam update group ~GROUP_EMAIL add member user ~STUDENT

It appears to work but was wondering if there is a simpler way that I might not be aware of?

M Anon

unread,
Aug 18, 2021, 6:52:18 PM8/18/21
to GAM for Google Workspace
I meant to say "It DOES NOT appear to work and was wondering if there is a simpler way" ....

Ross Scroggs

unread,
Aug 18, 2021, 7:10:43 PM8/18/21
to google-ap...@googlegroups.com
gam csv filename.csv gam update group ~GROUP_EMAIL clear members
gam csv filename.csv gam update group ~GROUP_EMAIL add member user ~STUDENT

Ross

--
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/d875ac74-e460-49eb-93c5-fcaf2e2f1d30n%40googlegroups.com.


--

M Anon

unread,
Aug 18, 2021, 7:55:16 PM8/18/21
to GAM for Google Workspace
Thanks Ross.

I tried it (BTW it accepts member only not memberS) and interestingly enough, using my test CSV with only 2 groups, it cleared the users out of the 2nd group but not the first. As a test, I added more groups and repeated the test and I can see some have been cleared but some are not (random).

I am on the latest 6.07 version.

Maj Marshall Giguere

unread,
Aug 18, 2021, 8:26:28 PM8/18/21
to google-ap...@googlegroups.com
Ross;

I noted the "clear member" option.  Can you point me the the api doc for the semantics.  I looked and came up empty.

Thanks
-Marsh


Maj Marshall E. Giguere, CAP
NH Wing Director of IT
U.S. Air Force Auxiliary
 


Ross Scroggs

unread,
Aug 18, 2021, 8:28:27 PM8/18/21
to google-ap...@googlegroups.com
Marsh,

It's not in the API, gam gets the members and then tosses them,

Ross



--

Maj Marshall Giguere

unread,
Aug 18, 2021, 8:34:08 PM8/18/21
to google-ap...@googlegroups.com
Ross;

So, gam "clear" is a convenience function.  Does what I do with my database app, but with less work on my part. ;-)


Maj Marshall E. Giguere, CAP
NH Wing Director of IT
U.S. Air Force Auxiliary
 

Ross Scroggs

unread,
Aug 18, 2021, 8:37:35 PM8/18/21
to google-ap...@googlegroups.com
Yep. That's me, Mr. Convenience.



--

M Anon

unread,
Aug 22, 2021, 10:56:51 PM8/22/21
to GAM for Google Workspace
Hi,

gam clear unfortunately, does not work for us ... the members and owners are still there. Any other recommendations?

Ross Scroggs

unread,
Aug 23, 2021, 8:57:46 AM8/23/21
to google-ap...@googlegroups.com
gam update group <GroupItem> clear [member] [manager] [owner] [notsuspended|suspended]
If you want to clear the owners and mangers, you have to indidate that's what you wantto do.
gam update group gr...@domain.com clear manager owner

Ross

M Anon

unread,
Aug 23, 2021, 3:44:00 PM8/23/21
to GAM for Google Workspace
Hi Ross,

My apologies for not being clear. Yes, that's what I meant:

gam csv groups.csv gam update group ~GRP_EMAIL clear owner
gam csv groups.csv gam update group ~GRP_EMAIL clear member

The 2 commands above does not work. When I do a:

gam info group 11-EXAMPL...@ourschool.domain

It shows the owners (teachers) and members (students) still there.

Ross Scroggs

unread,
Aug 23, 2021, 4:01:15 PM8/23/21
to google-ap...@googlegroups.com
M Anon,

What is the output from these commands?

Ross



--

M Anon

unread,
Aug 24, 2021, 8:01:02 PM8/24/21
to GAM for Google Workspace

As I was trying to capture the output, I noticed that it works when I run it without the "GAM CSV" prefix. But as soon as I use it with "gam csv", it fails:

gam clear 1.png

gam clear 2.png

I also notice that when I use it with GAM CSV, it doesn't tell me it's removing the users whereas with just GAM UPDATE, it does tell me (green arrow)

gam clear 3.png

Ross Scroggs

unread,
Aug 24, 2021, 11:12:03 PM8/24/21
to google-ap...@googlegroups.com
You are using Jay's Standard GAM. It does not correctly process bulk group membersship changes when you do gam csv.


On Aug 24, 2021, at 5:01 PM, M Anon <afn2...@gmail.com> wrote:


As I was trying to capture the output, I noticed that it works when I run it without the "GAM CSV" prefix. But as soon as I use it with "gam csv", it fails:

<gam clear 1.png>

<gam clear 2.png>

I also notice that when I use it with GAM CSV, it doesn't tell me it's removing the users whereas with just GAM UPDATE, it does tell me (green arrow)

<gam clear 3.png>

To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/fe2393c5-7c5a-4ba9-b702-7591c5877becn%40googlegroups.com.
<gam clear 2.png><gam clear 1.png><gam clear 3.png>

M Anon

unread,
Aug 24, 2021, 11:41:38 PM8/24/21
to GAM for Google Workspace
Thank you Ross.

I'll try the upgrade and report back.

M Anon

unread,
Aug 25, 2021, 1:12:16 AM8/25/21
to GAM for Google Workspace
That worked. Thanks Ross!
Reply all
Reply to author
Forward
0 new messages