A unified data governance solution that helps manage, protect, and discover data across your organization
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .
Ask: I am trying to create sensitivity labels for groups and sites, but we need to run some PowerShell commands. I am following the steps in this https://learn.microsoft.com/en-us/purview/sensitivity-labels-teams-groups-sites, but it is not clear to me. Could you please send me all the PowerShell commands I need to run in order to enable sensitivity labels for groups and sites?
Thank you.
Screenshot 2024-08-15 234751.png
Solution: I did the following and it worked for me
- connect to PowerShell ISE as admin
- Install-Module Microsoft.Graph -Scope CurrentUser
- Install-Module Microsoft.Graph.Beta -Scope CurrentUser
- Connect-MgGraph -Scopes “Directory.ReadWrite.All”
- Connect-AzureAD
- Get-MgBetaDirectorySettingTemplate
- $TemplateId = (Get-MgBetaDirectorySettingTemplate | where { $_.DisplayName -eq "Group.Unified" }).Id
- $Template = Get-MgBetaDirectorySettingTemplate | where -Property Id -Value $TemplateId -EQ
- $params = @{ templateId = "$TemplateId" values = @(
)@{ name = "UsageGuidelinesUrl" value = "https://guideline.example.com" } @{ name = "EnableMIPLabels" value = "True" }
}
- New-MgBetaDirectorySetting -BodyParameter $params
- $Setting = Get-MgBetaDirectorySetting | where { $_.DisplayName -eq "Group.Unified"}
$Setting.Values
If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.
If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.
Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.