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?

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Accepted answer
  1. Vasil Michev 119.6K Reputation points MVP Volunteer Moderator
    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.