blog.atwork.at

news and know-how about microsoft, technology, cloud and more.

Activate the sensitivity label for Groups and Sites with Graph PowerShell

Need to activate the Microsoft 365 sensitivity labels for Groups and Sites? This must be done with PowerShell. Find the current working script here.

The article Assign sensitivity labels to Microsoft 365 groups in Microsoft Entra ID describes basically how to activate the Groups and Sites settings with Microsoft Beta Graph PowerShell: "...To apply published labels to groups, you must first enable the feature. These steps enable the feature in Microsoft Entra ID....". My colleague Christoph Wilfing corrected and completed the script so that it optimizes module loading times and works in all cases. Thx Christoph!

The goal is that new sensitivity labels can be set with the scope for Groups and Sites in the Microsoft Purview compliance portal as here.

image

You can find the working PowerShell sample script in the atworkat/GovernanceToolkit365 repo.

image

The script works in PowerShell Core and checks whether the required EnableMIPLabels settings already exist or not with the Graph Beta Powershell command Get-MgBetaDirectorySetting. The settings are activated in both cases.

We hope this quick script helps to work with sensitivity labels in your Microsoft 365 tenant´s Groups and Sites.

Loading