I titled this thread "Google classroom teachers_group members" as that is ultimately what I'm trying to do but my quest spans multiple GAM functions. I'm trying to automate the process of adding teachers to the google-created classroom_teachers group for Google Classroom.
Our org structure is like this--
Root
--JR HI Users
----JR HI Students
--SR HI Users
----SR HI Students
Where teachers are in the respective "Users" groups and students are in the students group below. We also have two groups called "jrhiteachers" and "srhiteachers" with the teachers of each school in them. Users are added and removed and the membership of those groups are all handled by GADS. I'm trying to figure out the best method to add new teachers to the classroom_teachers group.
My first idea was to export a list of users from each teacher group and them add them to the classroom_teachers group, most likely through command piping. However, the command (gam print users query "orgUnitPath='/JR HI Users'") prints all users in that group and all subgroups. I couldn't find any way to only list the users directly in that OU.
My next idea was to list the members of the two teacher groups that we have. I see I can do a "gam info group group_name" but that also lists a lot of details along with the members so I would have to write a second parsing script to parse that output. Is there a way to get a clean list of just members of a group?
My third idea was to use the group sync function. I tested creating a test group and then running the command (gam update group
test...@mydomain.com sync member org "/JR HI Users") and that worked beautifully by adding only the users directly in that OU. Problem is my teachers are in a few different OUs so I don't see any way I can sync multiple OUs to a group.
Any insight would be appreciated.
Thanks,
Matt