Thank you Simon.
Your StudentGroupEmail, is that the email of a Google Group that only contains students? If it is, how do you allow teachers to send to that group if they're not a member?
I tried using the “gam course ~COURSE_ID sync students group ~GOOGLE_GROUP_EMAIL” last year but had to discontinue it when it resulted in ALL users within the Google Group being synced (teachers who were owners of the group got added in as students).
From: 'Simon Wright' via Techies for schools <
techies-f...@googlegroups.com>
Sent: Monday, 31 January 2022 5:10 pm
To:
techies-f...@googlegroups.com
Subject: Re: [techies-for-schools] RE: Managing Classroom and Groups with GAM?
CAUTION: This email originated from outside of Rangitoto College. Be careful about clicking on links or opening attachments. If in doubt, ask IT.
We use/generate a master csv file and run a simple powershell script which calls a couple of GAM commands to generate the google classrooms...
So for the start of this year we use last years csv to go through and archive what are now last years classrooms before creating this years 2022 ones.
The archive script...
Import-Csv C:\Support\gclassroom\2021_archivelist.csv | ForEach-Object {
Write-Host "Archiving Class: Alias: $($_.Alias)"
gam update course "$($_.Alias)" status ARCHIVED
}
This is the main script to generate classes, add the teacher and a secondary teacher by way of the HoD then lastly sync'ing the class group to bring in all the students....
Import-Csv C:\Support\gclassroom\ StartOfYearGoogleClassrooms2022.csv | ForEach-Object {
Write-Host "Creating Class: Code: $($_.Code) | Name $($_.ClassName) | Teacher: $($_.TeacherEmail)"
gam create course alias "$($_.Alias)" name "$($_.ClassName)" teacher "$($_.TeacherEmail)" status ACTIVE
Write-Host " Adding Teacher: $($_.HODEmail)"
gam course "$($_.Alias)" add teacher "$($_.HODEmail)"
Write-Host " Syncing Class Group: $($_.StudentGroupEmail)"
gam course "$($_.Alias)" sync students group "$($_.StudentGroupEmail)"
}
the spreadsheet/csv looks like this...
Basic info exported (first 6 columns) direct from Kamar
Code column =CONCATENATE(A2,"-",B2)
Alias column =CONCATENATE("2022-",G2)
ClassName column =CONCATENATE(A2," (",B2,") 2022")
StudentGroupEmail =CONCATENATE(G2,"@
http://obhs.school.nz")
The "TeacherEmail" & "HODEmail" columns i'll have to defer to Pete to answer as he is the one who generates this spreadsheet.
The "StudentGroupEmail" refers to the group to sync the class with. These groups with the same email address are managed/sync'd into AD using
https://www.usync.nzand then onto Azure/Google.
Periodically, though daily this week, we run another script to keep the classes sync'd to the class groups....
Import-Csv C:\Support\gclassroom\StartOfYearGoogleClassrooms2022.csv | ForEach-Object {
Write-Host "Syncing Class: Alias: $($_.Alias) | Group: $($_.StudentGroupEmail)"
gam course "$($_.Alias)" sync students group "$($_.StudentGroupEmail)"
}
Hope this helps anyone else looking to add some automation to google classroom.
I am looking at adding support into uSync or perhaps a separate tool all together....but need to get the start of the year out the way first.
Regards,
Simon Wright
On Mon, 31 Jan 2022 at 13:13, 'Marlon Yu' via Techies for schools <mailto:
techies-f...@googlegroups.com> wrote:
Sorry, the code didn't paste right ... re-sending for readability
====== script starts ======
REM Create the corresponding Google Groups
gam csv "groups.csv" gam create group ~GRP_EMAIL name ~GRP_NAME description ~GRP_DESCRIPTION who_Can_View_Membership ALL_MANAGERS_CAN_VIEW who_Can_Post_Message ALL_MANAGERS_CAN_POST show_In_Group_Directory TRUE who_Can_Leave_Group ALL_MANAGERS_CAN_LEAVE who_Can_Discover_Group ALL_IN_DOMAIN_CAN_DISCOVER
REM Remove the current owners (this is for capturing teacher changes)
gam csv "groups.csv" gam update group ~GRP_EMAIL clear owner
REM Assign the utility account as owner to prevent orphaning the group when teacher accounts get disabled when they leave
gam csv "groups.csv" gam update group ~GRP_EMAIL add owner user mailto:
utility...@cloud.rangitoto.school.nz
REM Re-assign the current teachers of the class to the group
gam csv "teachers.csv" gam update group ~GROUP add owner user ~TEACHER
REM Remove the current students (this is done to capture the change where students leave the class)
gam csv "groups.csv" gam update group ~GRP_EMAIL clear member
REM Re-add the current list of students taking the class
gam csv "students.csv" gam update group ~GROUP add member user ~STUDENT
REM Create the classes
gam csv "groups.csv" gam create course alias ~COURSE_ID teacher mailto:
utility...@cloud.rangitoto.school.nz name ~GRP_NAME
REM Make the utility account the owner to prevent the class from becoming orphaned when the teacher's account is disabled and they don't transfer the class to someone else REM At the same time, mark the class ACTIVE or else the teacher will be asked to accept the class
gam csv "groups.csv" gam update course ~COURSE_ID owner mailto:
utility...@cloud.rangitoto.school.nz status ACTIVE
REM Add the current teachers into the class (multiple teachers may teach the same class)
gam csv "teachers.csv" gam course ~COURSE_ID add teacher ~TEACHER
REM Add the current students into the class
gam csv "students.csv" gam course ~COURSE_ID add student ~STUDENT
====== script ends ======
Marlon Yu, PMP, MIITP
IT Services Manager
Ph
+64 (9) 477 0150 Ext 650
-----Original Message-----
From: 'Marlon Yu' via Techies for schools <mailto:
techies-f...@googlegroups.com>
Sent: Monday, 31 January 2022 1:06 pm
To: mailto:
techies-f...@googlegroups.com
Subject: [techies-for-schools] Managing Classroom and Groups with GAM?
CAUTION: This email originated from outside of Rangitoto College. Be careful about clicking on links or opening attachments. If in doubt, ask IT.
Hello everyone,
Reaching out to anyone in the group using GAM (particularly the ADV-XTD3 version) to manage their Classroom and Groups. How do you capture teacher and student changes (i.e. when teachers or students leave the class) and new class creation?
Our current script is as follows and while we remove all teachers and students from the corresponding group before re-adding them in to capture the changes, I don't think we can do that for classes because the current students who will be re-added will most likely lose current assignments / shared docs.
Any recommendations?
====== script starts ======
REM Create the corresponding Google Groups gam csv "groups.csv" gam create group ~GRP_EMAIL name ~GRP_NAME description ~GRP_DESCRIPTION who_Can_View_Membership ALL_MANAGERS_CAN_VIEW who_Can_Post_Message ALL_MANAGERS_CAN_POST show_In_Group_Directory TRUE who_Can_Leave_Group ALL_MANAGERS_CAN_LEAVE who_Can_Discover_Group ALL_IN_DOMAIN_CAN_DISCOVER
REM Remove the current owners (this is for capturing teacher changes) gam csv "groups.csv" gam update group ~GRP_EMAIL clear owner
REM Assign the utility account as owner to prevent orphaning the group when teacher accounts get disabled when they leave gam csv "groups.csv" gam update group ~GRP_EMAIL add owner user mailto:
utility...@cloud.rangitoto.school.nz
REM Re-assign the current teachers of the class to the group gam csv "C:\SQLCMD_scripts\Google Groups\teachers.csv" gam update group ~GROUP add owner user ~TEACHER
REM Remove the current students (this is done to capture the change where students leave the class) gam csv "C:\SQLCMD_scripts\Google Groups\groups.csv" gam update group ~GRP_EMAIL clear member
REM Re-add the current list of students taking the class gam csv "C:\SQLCMD_scripts\Google Groups\students.csv" gam update group ~GROUP add member user ~STUDENT
REM Create the classes
gam csv "C:\SQLCMD_scripts\Google Groups\groups.csv" gam create course alias ~COURSE_ID teacher mailto:
utility...@cloud.rangitoto.school.nz name ~GRP_NAME
REM Make the utility account the owner to prevent the class from becoming orphaned when the teacher's account is disabled and they don't transfer the class to someone else REM At the same time, mark the class ACTIVE or else the teacher will be asked to accept the class gam csv "C:\SQLCMD_scripts\Google Groups\groups.csv" gam update course ~COURSE_ID owner mailto:
utility...@cloud.rangitoto.school.nz status ACTIVE
REM Add the current teachers into the class (multiple teachers may teach the same class) gam csv "C:\SQLCMD_scripts\Google Groups\teachers.csv" gam course ~COURSE_ID add teacher ~TEACHER
REM Add the current students into the class gam csv "C:\SQLCMD_scripts\Google Groups\students.csv" gam course ~COURSE_ID add student ~STUDENT
====== script ends ======
Marlon Yu, PMP, MIITP
IT Services Manager
Ph
+64 (9) 477 0150 Ext 650
*** RANGITOTO COLLEGE EMAIL DISCLAIMER *** The contents of this email and any attachments are confidential and may be legally privileged. If you are not the intended recipient please advise the sender immediately and delete the email and attachments. Any use, dissemination, reproduction or distribution of this email and any attachments by anyone other than the intended recipient is prohibited.
*** RANGITOTO COLLEGE EMAIL DISCLAIMER ***
--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:
techies-for-schools%2Bunsu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/techies-for-schools/SY2PR01MB229826543FAB9B47B6110F0EB8259%40SY2PR01MB2298.ausprd01.prod.outlook.com.
*** RANGITOTO COLLEGE EMAIL DISCLAIMER ***
The contents of this email and any attachments are confidential and may be legally privileged. If you are not the intended recipient please advise the sender immediately and delete the email and attachments. Any use, dissemination, reproduction or distribution of this email and any attachments by anyone other than the intended recipient is prohibited.
*** RANGITOTO COLLEGE EMAIL DISCLAIMER ***
--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:
techies-for-schools%2Bunsu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/techies-for-schools/SY2PR01MB2298CFCEFBEAE0BF6D2D7720B8259%40SY2PR01MB2298.ausprd01.prod.outlook.com.
DISCLAIMER
This e-mail is intended for the addressee only and may contain information which is subject to legal privilege. This e-mail message and accompanying data may contain information that is confidential and subject to privilege. Its contents are not necessarily the official view Otago Boys’ High School or communication of the Otago Boys’ High School. If you are not the intended recipient you must not use, disclose, copy or distribute this e-mail or any information in, or attached to it. If you have received this e-mail in error, please contact the sender immediately or return the original message to Otago Boys’ High School by e-mail, and destroy any copies. Otago Boys’ High School does not accept any liability for changes made to this e-mail or attachments after sending.
--
You received this message because you are subscribed to the Google Groups "Techies for schools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mailto:
techies-for-sch...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/techies-for-schools/CAEJps9rTEYPh%3DyoW1KKRx4fqTGCpRaiS2kB-oFLNAmAcuvd5Cg%40mail.gmail.com?utm_medium=email&utm_source=footer.