We encountered the same issue when creating Teams. The Notebook app fails to launch, and it seems something has changed on Microsoft's side regarding how Teams are provisioned.
Previously, we created a group first and then promoted it to a Team using an Edu_C template. However, when we now create a new Team this way, the Notebook throws an error.
Old Method (Group → Team)
# Create Group
$params = @{
displayName = $name
mailNickname = $name
description = $name
groupTypes = @("Unified")
mailEnabled = $true
securityEnabled = $false
visibility = "HiddenMembership"
creationOptions = @("ExchangeProvisioningFlags:461", "classAssignments")
extension_fe2174665583431c953114ff7268b7b3_Education_ObjectType = "Section"
}
# $Newgroup = New-MgGroup -BodyParameter $params
$groupResponse = Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/groups" -Body $params
$groupId = $groupResponse.id
New Working Method (Create Class → Promote to Team)
Instead of creating a group first, you now need to create an Education Class. Once you promote this class to a Team, the Notebook works correctly.
# Payload for education class
$params = @{
displayName = $name
mailNickname = $name
description = "$name class group"
classCode = "BIO101"
externalId = "BIO101-3558"
externalName = $name
externalSource = "sis"
} | ConvertTo-Json -Depth 10
# Call to beta endpoint
$groupResponse = Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/beta/education/classes" -Body $params
This new method is only useful for future provisioning. Luckily, existing groups can still be repaired.
Fix for Existing Groups
The EDU OneNote app needs permissions on the underlying SharePoint site. Reference:
https://support.microsoft.com/en-us/topic/provisioning-class-notebooks-and-sites-at-scale-using-microsoft-graph-apis-cd9dc583-fd1b-4ee3-ac21-d585b0802db0
I created a little script to automate this fix: (Use at own risk)
#Connect to Microsoft Graph
Connect-MgGraph -Scopes "Sites.FullControl.All","Group.Read.All","User.Read.All"
#Add Temp Owner
$user = Get-MgUser -UserId "******@school.nl"
$ownerId = $user.Id
#Get all the Groups
$AllTeams = Get-MgTeam -All
#Specify the Teams to Repair.
$Repair = $allTeams | Where-Object { $_.DisplayName -like "25-26*" }
#Add Owner
ForEach ($R in $Repair) {
#Set the Owner
#Owner
$newGroupOwner =@{
"@odata.id"= "https://graph.microsoft.com/v1.0/users/{$ownerId}"
}
Write-Host Set $user.DisplayName as Owner for $($R.DisplayName)
#Add the Owner
$groupId = $R.Id
New-MgGroupOwnerByRef -GroupId $groupId -BodyParameter $newGroupOwner -ErrorAction SilentlyContinue
}
# EDU service app IDs waarvoor de site FullControl nodig heeft
$eduApps = @(
@{ id = "22d27567-b3f0-4dc2-9ec2-46ed368ba538"; name = "EDU Teams Assignment" },
@{ id = "c9a559d2-7aab-4f13-a6ed-e7e9c52aec87"; name = "EDU Teams Notebook" },
@{ id = "13291f5a-59ac-4c59-b0fa-d1632e8f3292"; name = "EDU OneNote" },
@{ id = "2d4d3d8e-2be3-4bef-9f87-7875a61c29de"; name = "EDU Teams Files" },
@{ id = "8f348934-64be-4bb2-bc16-c54c96789f43"; name = "EDU Teams Calendar" }
)
# Fix the site and the Remove Owner
ForEach ($R in $Repair) {
#Get the Site ID
$groupid = $R.Id
$site = Invoke-MgGraphRequest -Method GET -Uri "https://graph.microsoft.com/v1.0/groups/$groupId/sites/root"
$site.id
#Loop the apps
ForEach ($app in $eduApps) {
$body = @{
roles = @("fullcontrol")
grantedToIdentities = @(@{
application = @{
id = $app.id
displayName = $app.name
}
})
}
Write-Host "Reset permissions for $($app.name) on $($R.DisplayName)" -ForegroundColor Cyan
Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/sites/$($site.id)/permissions" -Body $body
}
#Remove the Owner
Write-Host Remove $user.DisplayName as Owner for $($R.DisplayName)
Remove-MgGroupOwnerByRef -GroupId $groupId -DirectoryObjectId $ownerId -ErrorAction SilentlyContinue
}
EDIT: I've updated the script due to issues we've encountered with file uploads in Assignments. It appears we also need to include the following apps to ensure proper functionality:
@{ id = "22d27567-b3f0-4dc2-9ec2-46ed368ba538"; name = "EDU Teams Assignment" },
@{ id = "c9a559d2-7aab-4f13-a6ed-e7e9c52aec87"; name = "EDU Teams Notebook" },
@{ id = "13291f5a-59ac-4c59-b0fa-d1632e8f3292"; name = "EDU OneNote" },
@{ id = "2d4d3d8e-2be3-4bef-9f87-7875a61c29de"; name = "EDU Teams Files" },
@{ id = "8f348934-64be-4bb2-bc16-c54c96789f43"; name = "EDU Teams Calendar" }