taers232c / GAMADV-XTD3

Command line tool to manage Google Workspace
723 stars 86 forks source link

Transferring class ownership for a class with a broken owner invitation. #325

Closed ShaunNeighbourSwale closed 3 months ago

ShaunNeighbourSwale commented 1 year ago

Advice from Google;

_I got a response from the team and they provided the following steps to successfully transfer the owner of a provisioned class:

Go to this link using the super admin account https://developers.google.com/classroom/reference/rest/v1/courses/list In the right panel, 'Try this API', in the Teacher ID give the email id of the co- teacher from the affected classroom. At the bottom, you will get a list of your classes. Find the ID of the class you want to transfer the ownership Now please go to this link - https://developers.google.com/classroom/reference/rest/v1/courses/patch Paste the copied ID in the id field Enter 'ownerId' in the update mask field. In 'Request Body', click '+ Add request body parameters' and select 'ownerID' Give the teacher's email address to whom you want to transfer the ownership of the class to in the ownerId field. And Click execute. Confirm whether you receive a “200” response_

ShaunNeighbourSwale commented 1 year ago

I've tested this on a few classes where the owner could not be changed because there was a pending owner invitation, and the pending owner invitation could not be accepted/deleted because Google.....

It appears to work.

Any chance of adding this to GAM? Maybe;

"GAM update course COURSEID forceowner OWNEREMAIL"

The command should;

  1. Add the new owner as an additional teacher.
  2. Execute this patch method to force the new owner.