"Activate" function with new-mgteam

Philipp Flury 0 Reputation points
2023-11-14T14:56:32.9+00:00

We create teams for our school using Powershell. We used to use the Powershell command new-team for this. Now we use the Graph module with new-mgteam.

Since we created the teams with new-mgteam, the teams no longer need to be activated by an owner, but are activated immediately. See screenshot.

User's image

Old Command:

New-Team -DisplayName $Team -Description $Beschreibung -template EDU_Class -mailnickname $Mail -Owner $Admin

New Command:

$params = @{
                "template@odata.bind" = "https://graph.microsoft.com/v1.0/teamsTemplates('educationClass')"
                displayName = $Team
                description = $Beschreibung
                mailnickname = $Mail
                members = @(
                @{ 
                    "@odata.type" = "#microsoft.graph.aadUserConversationMember"
			         roles = @(
				     "owner"
			         )
			         "user@odata.bind" = "https://graph.microsoft.com/v1.0/users('$adminID')"
		             }      
	            )
                }
            New-MgTeam -BodyParameter $params

How can we reactivate this function? Because we want our teams to be prepared before Members can use it.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,463 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,506 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,401 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,676 questions
{count} votes

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.