https://graph.microsoft.com/v1.0/education/classes/{educationClass-id}/assignmentDefaults will always return forbidden

Jonathan Anderson 170 Reputation points
2023-09-06T15:32:06.82+00:00

As title assignment defaults will always return forbidden, when trying to patch, whether using graph explorer, Get-MgEducationClassAssignmentDefault with the powershell SDK and the python SDK. I've tried with both user and app scope application, many teams and all the required permissions.

Is there a workaround to setting assignment defaults in bulk I could use, and is this rest endpoint broken?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,894 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,483 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Sebastian Cerazy 316 Reputation points
    2023-11-20T12:51:37.0966667+00:00

    Any update?

    I cannot make myself an owner of every Team just to change defaults!

    edit:

    As there is no better way I had to:

    Get-Team | where-object {$_.DisplayName -like ("2023-*")} | Select-Object GroupId | Export-Csv c:\temp\GroupID.csv -NoTypeInformation 
    
    Import-CSV -Path c:\temp\GroupID.csv | ForEach { 
    Add-TeamUser -GroupId $_.id -User UPN -Role owner
    }
    
    Import-csv -path c:\temp\GroupID.csv | ForEach {
    Update-MgEducationClassAssignmentDefault -EducationClassId $_.id -DueTime 09:00:00
    }
    
    Import-CSV -Path C:\temp\GroupID.csv | ForEach {
    Remove-TeamUser -GroupId $_.id -User UPN
    }
    

  2. Sebastian Cerazy 316 Reputation points
    2024-09-12T11:23:43.5433333+00:00

    A year later and the same code simply no longer works!

    One machine 1 I get:

    cmdlet Update-MgEducationClassAssignmentDefault at command pipeline position 1
    Supply values for the following parameters:
    EducationClassId: d710f1b9-bb50-4207-9d04-0c3e11f1f322
    Update-MgEducationClassAssignmentDefault : One or more errors occurred.
    At line:1 char:1
    
    

    I went back to my management VM (that did not have cmdlets updated)

    Still worked fine, but I had to REDO one more time

    Connect-MgGraph -Scopes "EduAssignments.ReadWrite" , "EduRoster.ReadBasic" -TenantId 00000000-aaaa-bbbb-cccc-dddddddddddd
    
    0 comments No comments

  3. Jonathan Anderson 170 Reputation points
    2024-10-03T12:11:32.1066667+00:00

    Still not fixed, but anyone needing the same endpoint can follow this:

    https://jheesbrough.dev/articles/how-to-change-the-default-settings-for-teams-assignments-in-bulk

    Until the endpoint works as intended.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.