Want to sync G-Suite Group memberships from a Google Sheet using Apps Script

80 views
Skip to first unread message

Glenn Allan

unread,
Apr 19, 2020, 7:14:22 AM4/19/20
to GAM for G Suite
I am aware of this post, but would prefer to do it using Apps Script for simplicity

I was using a Google Sheet Addon called Naavi Groups Sync but that has been discontinued


Group Members for each group, column D, are comma separated in a single cell in column G, I previously used this to maintain around 60 groups

Thankyou in advance

+KimNilsson

unread,
Apr 25, 2020, 5:41:59 AM4/25/20
to GAM for G Suite

Ross Scroggs

unread,
Apr 25, 2020, 10:09:47 AM4/25/20
to google-ap...@googlegroups.com
Glenn,

This is a one-liner with Advanced GAM (https://github.com/taers232c/GAMADV-XTD3)
Use the Google Sheet file name:
gam redirect stdout ./MemberUpdates.txt multiprocess redirect stderr stdout csv gsheet us...@domain.com name "Groups Synch" "GSAutG" gam update group "~Group Email" sync members users "~Members"

Use the Google Sheet file ID:
gam redirect stdout ./MemberUpdates.txt multiprocess redirect stderr stdout csv gsheet us...@domain.com 999hpmS2hJho69N_P5-u03HiO0sdeeUu1e7ABO3Uizzz "GSAutG" gam update group "~Group Email" sync members users "~Members"

redirect stdout ./MemberUpdates.txt multiprocess redirect stderr stdout - Save audit information
csv gsheet us...@domain.com name "Groups Synch" "GSAutG" - Source data using Google Sheet file name, adjust names accordingly
csv gsheet us...@domain.com 999hpmS2hJho69N_P5-u03HiO0sdeeUu1e7ABO3Uizzz "GSAutG" - Source data using Google Sheet file ID, adjust ID/names accordingly
gam update group "~Group Email" sync members users "~Members" - Action to perform

Ross



The information contained in the above e-mail message or messages (which includes any attachments) is confidential and may be legally privileged. It is intended only for the use of the person or entity to which it is addressed. If you are not the addressee, any form of disclosure, copying, modification, distribution or any action taken or omitted in reliance on the information is unauthorised. Opinions contained in the message(s) do not necessarily reflect the opinions of the Diocesan Catholic Education Office, Townsville. If you received this e-mail message in error, please notify the sender immediately and delete the message from your computer.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/761e3da4-9854-493c-b946-aaba29cf2670%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages