Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Friday, 20 August 2021

Google Classroom - How to get a list of all classes/classrooms

You can use the GAM utility to easily export the details of all Google Classrooms in your domain by following the commands below. In this example we'll be exporting the details to a CSV file

(Be sure to update the path to gam.exe and the output CSV file location)

$allclasses = C:\admin\gam\gam.exe print courses > "C:\Admin\Google Classroom\allclasses.csv"

This works well, but if you look at your CSV file you'll notice that firstly, it isn't formatted into columns properly, and secondly, there are a heap of fields called "coursematerial" that aren't required. We can filter out those fields by using the command below

$allclassesfiltered = import-csv "C:\Admin\GoogleClassroom\allclasses.csv" | select-object * -ExcludeProperty "courseMaterial*"

We can then re-export the CSV file with the command below which will actually export it correctly as a CSV file with data separated into columns correctly

$allclassesfiltered | export-csv "C:\Admin\Google Classroom\allclasses-filtered.csv" -NoTypeInformation


Thursday, 19 August 2021

GAM - How To Sync Google Classroom Students from CSV File

GAM is great command line utility that fills a huge void in the management of Google Classroom - since Google haven't bothered after all these years to create any kind of centralised management interface for the product despite a huge uptake in use from COVID-19 and remote learning.

One of the downfalls of GAM is it can be a little slow - if you wanted to add students individually to a class, the command to add each student takes several seconds to execute - which doesn't sound like much, but in a large school with lots of students and lots of classes - it could take hours to complete.

Thankfully, they have included the ability to synchronise members (students) of a class from a CSV file. What they don't mention in their documentation though is how the CSV file should be formatted - kind of important, right?

The CSV file should be formatted as a basic list - with a single column and no column headings - containing the email addresses of the students you wish to add. If you opened it in Notepad - it would look like the screenshot below

Example CSV file format to sync students to Google Classroom with GAM

One thing to note - if you are going to sync from a CSV file, it will add all the students in the CSV file to the classroom, but it will also remove any students already in the classroom who aren't listed in the CSV file, so it's important your CSV file contains all the students in the class.

The command to run the sync is below;

C:\admin\gam\gam.exe course "googlecourseid"  sync students file "C:\admin\GoogleClassroom\class1.csv"

(Be sure to update the path to your gam.exe file, the google course ID and the CSV file location)

Tuesday, 11 May 2021

Managing Google Classroom with GAM and Powershell

Part of my job requires me to actively manage our instance of Google Classroom - the adding/removal of teachers, students, changing of class owners are just a couple of the every day tasks that are required. Unfortunately, Google Classroom doesn't have an included management interface for doing this - but there is a great command line utility called "GAM" which I use to accomplish these tasks.

I looked at a few different management utilities to do this - and essentially left GAM until last as I was really after a reliable (and free) utility that had a graphical user interface (GUI) instead of command line, but unfortunately at the time I was looking there was nothing that met these requirements (and worked) for me.

GAM can be downloaded from here - they have an excellent Wiki section with detailed instructions on how to get GAM setup and running within your environment.

In subsequent blog posts I'll be covering some of the scripts/commands that I use to manage and bring some control over Google Classroom such as identifying active classes, exporting them to CSV, archiving (disabling) old classes that are no longer required, synchronising members (teachers and students) and managing/maintaining the owners of Classrooms.

I'll be executing GAM commands from within powershell to do this.

What tool do you use for managing Google Classroom? Do you wish Google would create some kind of web/graphical user interface to do this?