Jump to content

Recommended Posts

Posted

Hi everyone,

 

We use GSuite (Google for Education) and have several Google Classroom classes where the teachers have not archived the old classes or the teachers have now left.

 

I would like to find a way to delete these old classes as students are using them as chat rooms and to post irrelevant content.

 

Is there a way to do this?

 

 

Thankyou.

Posted (edited)

I suspect GAM will be the way forward there, making use of its CSV batch commands.

 

https://gamcheatsheet.com/GAM%20Cheat%20Sheet%20A3.pdf

 

You'll need to run some commands in order to gather the course IDs that you will then need to list in a CSV file to archive or delete them.

 

With a list of target course IDs in a CSV file with a column named "courseID", you'd run the following to archive them all:

 

gam csv coursesToArchive.csv gam update course ~courseID status ARCHIVED

Edited by jthompson
  • Thanks 2
Posted

I can't find a copy of it online now, but not being very au fait with GAM, I use Alice Keeler's Google Classroom "List classes" management scripts. They're built into a Google Sheet and run as add ins.

 

It's made administering our Google Classrooms so much easier, I don't have to be an admin in each class to do things, just an admin in our Workspace tenant.

  • Thanks 2
Posted (edited)

gam print courses teacher [email protected] state active todrive

 

> this outputs the list to a Google Sheet

 

I download the google sheet to my machine and add a new column, NewName to the end of the columns.

 

Save the document and run

 

gam csv C:\gam\Rename2023_24courses.csv gam user [email protected] update drivefile "~teacherFolder.id" newfilename "~NewName"

 

> for gam to tell me "ERROR: 1k1rtg4ks4j3ulitj-8vwp8r2iwrsqa784vnqmpwyohqqm7m6x2ojgi4bqm8f3mklow9mhyf is not a valid argument for "gam update drivefile" "

- what's this error all about?

Edited by timbo343
  • Thanks 1
Posted
I can't work out what you're trying to do there. Your first gam command makes sense (fetching a list of active courses owned by a particular teacher). What are the other two attempting to do?
Posted
I can't work out what you're trying to do there. Your first gam command makes sense (fetching a list of active courses owned by a particular teacher). What are the other two attempting to do?

 

I'm trying to rename classes in bulk and Gam is peeing me off!

 

After i've downloaded the courses i would take a copy of the Google Sheet and make a new column called NewName.

 

I got this sample from a Google Group:

 

Sample:

$ gam print courses teacher [email protected] >courses.csv

Add a new column, NewName, to tscourses.csv

$ gam csv courses.csv gam user "~ownerId" update drivefile "~teacherFolder.id" newfilename "~NewName"

 

But i cannot work out how to change the classname.

Posted

That looks better, yep. Pretty much everything Classroom related will rely on you giving it a course ID to work with.

 

The cheat sheet I linked to earlier is handy for determining what commands and parameters you need to put together.

Posted
Also, as an aside, I'd recommend installing gam into Google Cloud Shell and running it from there. You're not then having Google Workspace superadmin credentials sitting in a JSON file on your computer!
  • Thanks 1
Posted
Also, as an aside, I'd recommend installing gam into Google Cloud Shell and running it from there. You're not then having Google Workspace superadmin credentials sitting in a JSON file on your computer!

 

This is the way.

Posted
Also, as an aside, I'd recommend installing gam into Google Cloud Shell and running it from there. You're not then having Google Workspace superadmin credentials sitting in a JSON file on your computer!

 

I looked at trying to do that but i gave up - is it actually easy to do as it would make life so much easier?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...