# Manual Teams class creation — source example

Inspect the captured manual education-class creation example. The source explicitly says a missing class should be checked in Edumate rather than created by running this example.

!!!warning Source-derived reference
These notes were recovered from OneNote. Configuration, permissions and operating results have not been freshly verified. Confirm the applicable authority and environment before acting.
!!!

**NOTE**: YOU SHOULD NEVER NEED TO RUN THIS. If a team in missing or a teacher can't find it, then you should check with Edumate.

**Reference:**

- [Create educationClass - Microsoft Graph v1.0 \| Microsoft Learn](https://learn.microsoft.com/en-us/graph/api/educationclass-post?view=graph-rest-1.0&tabs=powershell)
- [New-MgBetaEducationClass (Microsoft.Graph.Beta.Education) \| Microsoft Learn](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.beta.education/new-mgbetaeducationclass?view=graph-powershell-beta#examples)

``` powershell
Import-Module Microsoft.Graph.Beta.Education
```

**\##ADDING NEW GROUP**

\#Group MailNickname: 2026-TheLakes-12HMS-1

\#Group Name: Year 12 Health and Movement Science 1 (2026)

\#Group Description: 12HMS 1 \| TheLakes

\#GroupOwnersCount: 1

\#GroupMembersCount: 4

``` powershell
$params = @{
```

"classCode" = "12HMS 1"

"externalSourceDetail" = "Powershell CCMX.MgGraphEducation"

"externalId" = "2026-TheLakes-12HMS-1"

"mailNickname" = "2026-TheLakes-12HMS-1"

"externalName" = "2026-TheLakes-12HMS-1"

"displayName" = "Year 12 Health and Movement Science 1 (2026)"

"description" = "12HMS 1 \| TheLakes"

}

``` powershell
$newgroup = New-MgBetaEducationClass -BodyParameter $params
```

``` powershell
$educationClassId = $newgroup.Id
```

\#USING THE \$educationClassId FROM THE ABOVE IS USED WHEN ASSIGNING AN OWNER TO THE TEAM

\#In this scenario \$educationClassId is equal to "164de2bc-1510-434f-8b8f-eef324e38e54".

\#The Id of the new owner is "84732a7b-824e-4276-9f97-03b13a7f893a".

**\##ADDING OWNER**

\#Group MailNickname: 2026-TheLakes-12HMS-1

\#Owner Name: [example owner; personal name omitted]

\#HELPER TO SEE EXISTING OWNERS IN M365:

\#\$(Invoke-MgGraphRequest -Method GET -Uri \#"[https://graph.microsoft.com/v1.0/education/classes/164de2bc-1510-434f-8b8f-eef324e38e54/teachers").Value](https://graph.microsoft.com/v1.0/education/classes/164de2bc-1510-434f-8b8f-eef324e38e54/teachers").Value)

\#ADDS AN OWNER TO THE GROUP

``` powershell
$ownerId = "84732a7b-824e-4276-9f97-03b13a7f893a"
```

``` powershell
$ApiParams = @{
```

"@odata.id" = "[https://graph.microsoft.com/v1.0/education/users/84732a7b-824e-4276-9f97-03b13a7f893a"](https://graph.microsoft.com/v1.0/education/users/84732a7b-824e-4276-9f97-03b13a7f893a")

}

Invoke-MgGraphRequest -Method POST -Uri "[https://graph.microsoft.com/v1.0/education/classes/164de2bc-1510-434f-8b8f-eef324e38e54/teachers/\$ref"](https://graph.microsoft.com/v1.0/education/classes/164de2bc-1510-434f-8b8f-eef324e38e54/teachers/$ref") -Body \$ApiParams

## Related guidance

- [Topic overview](Introduction.md)
- [Source review status](../../review/Review-status.md)
