read group settings from file?

69 views
Skip to first unread message

Luke Jaeger

unread,
Oct 5, 2023, 1:15:57 PM10/5/23
to GAM for Google Workspace
I have a bash script to update user lists in my group, and I'd like it to apply my preferred group settings as well. 

My settings are in a text file that looks like this: (no line breaks in the file)
allowExternalMembers false allowGoogleCommunication false allowWebPosting true [...]

but when I run this part of the script
theSettings=$(cat /path/to/group_settings.txt) ;
/Applications/gam update group someGroup "$theSettings" ;

I get an error because the output of 'cat' comes back in single quotes.
Is there a better way to do this? I know this is kind of a bash question but hoping someone here has solved this already.

thanks!

Ross Scroggs

unread,
Oct 5, 2023, 1:47:11 PM10/5/23
to google-ap...@googlegroups.com
Luke,

Each of the keywords and values must appear on the command line as a separate argument.
I don't know how to get bash to do that.

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/d264a888-32e4-41f9-8ea1-5ee17794e4fbn%40googlegroups.com.

Ross Scroggs

unread,
Oct 5, 2023, 2:11:27 PM10/5/23
to google-ap...@googlegroups.com
Luke,

You can do this:
Make group_settings.json
{"allowExternalMembers": False, "allowGoogleCommunication": False, "allowWebPosting": True}

gam update group someGroup json file group_settings.json

Ross
----
Ross Scroggs


On Oct 5, 2023, at 10:15 AM, Luke Jaeger <lja...@mtholyoke.edu> wrote:

Ross Scroggs

unread,
Oct 5, 2023, 2:51:14 PM10/5/23
to google-ap...@googlegroups.com
Ross
----
Ross Scroggs


On Oct 5, 2023, at 10:15 AM, Luke Jaeger <lja...@mtholyoke.edu> wrote:

Luke Jaeger

unread,
Oct 5, 2023, 3:14:49 PM10/5/23
to google-ap...@googlegroups.com
Thanks Ross!

When I try:

gam update group someGroup json file /path/to/settings.json

I get:

ERROR: json is not a valid argument for "gam update group"

Luke Jaeger | Technical Project Administrator
____________

____________

Book me on Pathways




You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/pMAHMpinQJg/unsubscribe.
To unsubscribe from this group and all its topics, 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/EB7AAE4F-F424-4FFE-8454-56AB785DB0DC%40gmail.com.

Ross Scroggs

unread,
Oct 5, 2023, 3:17:20 PM10/5/23
to google-ap...@googlegroups.com
Waht is: gam version
----
Ross Scroggs



Luke Jaeger

unread,
Oct 5, 2023, 3:21:56 PM10/5/23
to google-ap...@googlegroups.com
everything’s current I think --

GAM 6.58 - https://jaylee.us/gam - pyinstaller
Python 3.11.3 64-bit final
google-api-python-client 2.86.0
MacOS Ventura 13.6 x86_64

Luke Jaeger | Technical Project Administrator
____________

____________

Book me on Pathways



Ross Scroggs

unread,
Oct 5, 2023, 3:24:35 PM10/5/23
to google-ap...@googlegroups.com
Luke,

You have Standard GAM, it does not support JSON data as input; you need Advanced GAM.


If you'd like, send me a Meet/Zoom invitation and I'll walk you through the updrade.

Ross
----
Ross Scroggs



Luke Jaeger

unread,
Oct 24, 2023, 9:43:40 AM10/24/23
to google-ap...@googlegroups.com
Thank you, I’ll give that a shot!

Luke Jaeger | Technical Project Administrator
____________

____________

Book me on Pathways



Luke Jaeger

unread,
Nov 2, 2023, 11:25:17 AM11/2/23
to google-ap...@googlegroups.com
hi Ross, I got part way thru the GAMADV-XTD3 “upgrade from standard GAM" process but it seems I don’t have an oauth2service.json file anywhere. 

I would greatly appreciate your help ... can we schedule a zoom call at some point?

Luke Jaeger | Technical Project Administrator
____________

____________

Book me on Pathways



Ross Scroggs

unread,
Nov 2, 2023, 11:27:23 AM11/2/23
to google-ap...@googlegroups.com
You should have had client_secrets.json and oauth2service.json files in the same folder as the gam executable.

Ross
----
Ross Scroggs


Luke Jaeger

unread,
Nov 2, 2023, 11:36:01 AM11/2/23
to google-ap...@googlegroups.com
Nope! Not sure how it’s been working without it, but it’s not there:

drwxr-xr-x  11 ljaeger  admin       352 Sep  5 09:35 .
drwxr-xr-x   6 ljaeger  staff       192 Nov  2 11:21 ..
-rw-r--r--   1 ljaeger  admin     79259 Apr 26  2023 GamCommands.txt
-rw-r--r--   1 ljaeger  admin     11357 Apr 26  2023 LICENSE
-rwxr-xr-x@  1 ljaeger  admin       432 Aug 14  2018 client_secrets.json
-rwxr-xr-x   1 ljaeger  admin  28251744 Apr 26  2023 gam
-rwxr-xr-x   1 ljaeger  admin        10 Nov  2 11:11 lastupdatecheck.txt
-rwxr-xr-x   1 ljaeger  admin      1949 Oct 24 09:47 oauth2.txt
-rw-r--r--   1 ljaeger  admin         0 Oct 24 09:47 oauth2.txt.lock
-rw-r--r--   1 ljaeger  admin     67484 Apr 26  2023 roots.pem
-rw-r--r--   1 ljaeger  admin     39059 Jan  2  2020 whatsnew.txt


Luke Jaeger | Technical Project Administrator
____________

____________

Book me on Pathways



Reply all
Reply to author
Forward
0 new messages