How do you assign the sensitivity label in the creation of a new team with 'New-MgTeam'?

Crounse, TB (Tim) 20 Reputation points
2024-07-31T14:16:57.1233333+00:00

Hi,

We are currently trying to automate requests we get for the creation of a new Team.
In this creation, we want to be able to assign a certain sensitivity label.

In PowerShell, we've got it to generally work with basic information, but we can't seem to figure out which parameter determines the sensitivity label of the team.

This is how our code looks:
er1

And these are the sensitivity labels we have:
er2

We've tried using the '-Classification' parameter with a string value of one of the existing Sensitivity Labels, but then we get a error 400 BadRequest. (Not sure whether that's the correct parameter for this)

Is there a different parameter that should be used?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,311 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,273 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,596 questions
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 108.1K Reputation points MVP
    2024-07-31T17:49:13.0766667+00:00

    You can use Exchange Online PowerShell and the New-UnifiedGroup cmdlet, which exposes the -SensitivityLabelId parameter. Once a Group is crated, you can team-enable it via the Graph. Alternatively, you can create the Team without assigning a label, and use the Set-UnifiedGroup cmdlet post-creation.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.