Inner GeekTechnologies for LearningWeb Design

List all your Google Classrooms using Apps Script

As a Google Apps for Education admin you are probably getting everyone into Google Classroom. In my twenty plus years of using technology, Google Classroom is the most focused and useful tool for learning and teaching I’ve ever used.  It does what I want as a teacher: making the digital tools disappear so I can focus on helping my learners. And the feedback from the teachers I work with is hugely positive – something that, in truth, I rarely hear about technology in education.

As a Google Apps for Education admin, it would be really useful to see all the classrooms that have been created in your deployment.  This GoogleApps Script does just that. It will made a Sheet in your Drive called “Class Listing” which will contain a list of all the Classrooms you have permission to view (superadmins can we all of them).

You’ll need to use Google AppScript, add this code and enable the Drive, AdminDirectory and Classroom APIs for AppScript (from Resources->Advanced Google services…)

 

23 comments
  1. bpugh2

    Sorry, but sloppy reading. Enabled both, but now getting:

    The request was blocked. Quota configuration not found for the requesting project. (line 33, file “”)

  2. bpugh2

    I have all 3 enabled. Still getting:
    The request was blocked. Quota configuration not found for the requesting project. (line 33, file “”)

  3. Charlie Love

    Ok, you’ll also have to enable the APIs in the Google Developer Console. So when you go to Advanced Google Services… you’ll see a grey box at the bottom of the service window which says “These services must also be enabled in the Google Developers Console.” Click the link and enable the Admin SDK, Classroom and Drive APIs there too.

  4. Julia Harris

    First, this is AWESOME! I wasn’t sure how many teachers were using Google Classroom, and there’s a lot more than I thought. Great job!

    I did have a few questions and some feedback. The function stopped running and gave the error “Exceeded maximum execution time”. I ran it twice, and it stopped at different points. It looks like it’s pulling based on the creation date, so I’m not too worried about stopping right now. However as time goes on, this will cause a problem. For example, we currently have 538 active classes and one of the queries stopped at 739.

    Which gets to my next question.. is there a way to change the code to pull only ACTIVE classes and ignore ARCHIVED classes? I have basic knowledge of JavaScript, but not enough to write my own script or make changes like this.

    Thanks again for creating this!

  5. ferrarik

    I am getting the same error as bpugh2, when I go into the console, I enabled the APIs but it wants me to set credentials??

  6. Mitch

    Thank you so much for this script! I was wondering if you might be able to help as I want to add the department of the teacher but when I added var loc = ownerObj.organizations[0].department; it only processes 1/3 of the groups before Google Scripts times out. Is there a way to store the organizations array somewhere else to speed things up?

  7. Mike Allen

    Keep getting this error when trying to run script. any ideas?

    ReferenceError: “ownerObj” is not defined. (line 51, file “Code”)

  8. Serg Karavansky

    Charlie Love thank You very much for this script, more 12 month I use script and everything was perfect until yesterday, then running -> Internal error encountered. (line 34, file “List classroom”) (var courses = Classroom.Courses.list(optionalArgs);). Maybe You have some idea ? enabled the Drive, AdminDirectory and Classroom APIs for AppScript (from Resources->Advanced Google services…) and in the Google Developers Console enabled the Admin SDK, Classroom and Drive APIs there too

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.