Hi - I have a ticket with Google support. However, thought GAM itself might be a good place to ask too. I wrote a batch file, based on GAM commands, that uses a daily automated export from my schools MIS (as a CSV) to create new Classrooms, add teachers to Classrooms and add students to Classrooms. It runs using Task Scheduler once a day. I put it on my blog last year (
http://edtechschool.com/keeping-g-suite-and-google-classroom-in-sync-with-sims-daily-automated-and-free/).
As it tries to create courses for all entries in the spreadsheet (gam create course) it frequently returns 409 errors for duplicates (as I set the same alias for each unique class from the CSV). A bit lazy, and it would be nice for the MIS to not churn out duplicates, but the 409 error for duplicate classes means they won't get created so I thought what the heck, it won't create duplicate classes and it runs every day. Works for me!
Unfortunately, every time the command to create new classes runs the user appears to eat up the user's 2000 group quota (even though a 409 error is returned). I didn't realise this until users stopped being able to join new groups or create new classrooms due to this quota being reached after my script ran for several months chomping into the quota. I was able to prove this by creating some simulated users. After they've been added to 1000 duplicate classes they hit the 2000 total. This seems to match with Classroom's background feature of creating two hidden groups for each teacher who joins a classroom. The error I get back from GAM always indicates that the user has reached the 2000 group limit as well.
Unfortunately, I can't find a way to use GAM to reverse this. Ideally, I'd like GAM to tell me the hidden groups that have been created, or how it's eaten into the quota, and reverse it somehow. Perhaps giving me the group names to delete.
Don't worry, I'll version two the script too ;). Going to adapt it to use sync and update more and only run create once, or twice a year! I have learnt my lesson for sure! I didn't expect the groups to be created even if a 409 is returned. Unsure if GAM is the cause or the Google Classroom API does this whenever it's told to create a new class.
Any help would be much appreciated!