Microsoft Purview sensitivity labels can now govern guest access to cloud security groups in Microsoft Entra ID. The feature is still in preview, however, and comes with a major constraint: a label applied to a security group can no longer be replaced or removed. A reliable deployment therefore relies on a disposable group, a controlled synchronisation and a test performed with a non-privileged account.
What the label actually protects
As of 16 November 2026, labels applied to Microsoft Entra ID (formerly Azure Active Directory) security groups are still in preview. Microsoft Learn warns that their behaviour may still change before general availability, in particular for label changes and highly privileged roles.
On a security group, the supported capability is guest access control. The label acts as a protection rule for the container. It does not classify the objects or data that the group grants access to.
Validation takes place when the group is created or when the label is first assigned. A later change to the Purview policy does not trigger a re-evaluation of the members already present. An existing guest will therefore not be removed automatically.
As Vasil Michev explains, you need at least one container label covering Groups and sites, with the external user access setting configured. It is not possible to create a label dedicated solely to security groups.
The prerequisites rule out several types of groups
The tenant must have at least one Microsoft Entra ID P1 or P2 licence, or Microsoft 365 E3 or E5. The label must have been created and published in Microsoft Purview with the Groups and sites scope.
The EnableMIPLabels setting must also be set to True in the Group.Security directory settings template, whose identifier is d209f6fa-3839-4d70-b83f-60b1c64d0e8f. This template is separate from Group.Unified. Enablement already done for Microsoft 365 groups therefore does not cover security groups.
Prerequisites before the first test
- Check for a Microsoft Entra ID P1 or P2 licence, or Microsoft 365 E3 or E5
- Enable
EnableMIPLabelsinGroup.Security - Publish a label with the Groups and sites scope
- Explicitly configure external user access in this label
- Choose a static, disposable cloud security group
- Prepare a guest user and a test account with no administrative role
Not all groups are eligible.
| Group type | Eligible | Main constraint |
|---|---|---|
| Static cloud security group | Yes | No child groups during assignment |
| Dynamic membership group | No | Excluded during the preview |
| Group synchronised from Active Directory | No | Only cloud groups are supported |
| Exchange-managed or mail-enabled group | No | Includes distribution lists |
| Microsoft 365 group | Separate configuration | Uses the Group.Unified template |
The label is permanent on the security group
During the preview, the label cannot be changed or removed through the portal, PowerShell or Microsoft Graph. To fix a mistake, you must create a new group with the right label, then move the members to it.
The deployment must separate publication and assignment
Creating the label, publishing it and assigning it follow different cycles. You must also allow for replication delays between Microsoft Purview and Microsoft Entra ID.
Configure the label in Microsoft Purview
Select the Groups and sites scope, then define whether the label allows or blocks the addition of external users. Publish it only to the planned test scope.
Enable the Group.Security template
Check the EnableMIPLabels value in the Group.Security template. Do not reuse the Group.Unified configuration, even if labels already work on Microsoft 365 groups.
Synchronise the labels to Microsoft Entra ID
Open a Security & Compliance PowerShell session with Connect-IPPSSession, then run Execute-AzureADLabelSync. This cmdlet does not exist in the Microsoft Graph PowerShell SDK.
Wait for propagation before assigning
Labels can take up to 24 hours to appear after synchronisation. Microsoft also recommends waiting at least 24 hours after a change to the Groups and sites settings.
Label a disposable group and test a guest
Assign the label to a new static security group. Then test adding a guest with an account that has no administrative role and no application-based authentication.
The guide Assign sensitivity labels to security groups complements this sequence with the governance points to document. If the tenant uses nested groups, also check the risks detailed in our article on blocking the nesting of security groups.
Implementation
The following script synchronises an already published label, creates a test security group, applies the label with Microsoft Graph, checks assignedLabels, then attempts to add a guest. It uses Group.ManageProtection.All for the assignment and Group.ReadWrite.All, GroupMember.ReadWrite.All and User.Read.All for the full scenario.
Install the required modules with Install-Module Microsoft.Graph.Authentication -Scope CurrentUser and Install-Module ExchangeOnlineManagement -Scope CurrentUser. The preparation account must be allowed to run Execute-AzureADLabelSync and to create the group. The final test requires signing in again with a non-privileged account.
1param(2 [Parameter(Mandatory = $true)]3 [string]$LabelId,4 5 [Parameter(Mandatory = $true)]6 [string]$GuestUserId,7 8 [string]$TestGroupDisplayName = "SG-Purview-Label-Test",9 10 [switch]$LabelAllowsGuests,11 [switch]$SyncOnly,12 [switch]$DryRun13)14 15$ErrorActionPreference = "Stop"16 17Import-Module Microsoft.Graph.Authentication18Import-Module ExchangeOnlineManagement19 20if ($DryRun) {21 Write-Host "Simulation: no synchronisation and no Graph write."22 Write-Host "Label: $LabelId"23 Write-Host "Planned group: $TestGroupDisplayName"24 Write-Host "Planned guest: $GuestUserId"25 return26}27 28# Synchronises the Purview labels to Microsoft Entra ID.29Connect-IPPSSession30Execute-AzureADLabelSync31Write-Warning "Label availability can take up to 24 hours."32 33if ($SyncOnly) {34 Write-Host "Synchronisation started. Run the script again after propagation."35 return36}37 38# Delegated sign-in to create the group and assign its protection.39Connect-MgGraph -Scopes @(40 "Group.ReadWrite.All",41 "GroupMember.ReadWrite.All",42 "Group.ManageProtection.All",43 "User.Read.All"44) -ContextScope Process45 46# Creates a static, disposable cloud security group.47$mailNickname = "sgpurviewtest-$(Get-Date -Format 'yyyyMMddHHmmss')"48$groupBody = @{49 displayName = $TestGroupDisplayName50 mailEnabled = $false51 mailNickname = $mailNickname52 securityEnabled = $true53} | ConvertTo-Json54 55$group = Invoke-MgGraphRequest `56 -Method POST `57 -Uri "https://graph.microsoft.com/v1.0/groups" `58 -Body $groupBody `59 -ContentType "application/json"60 61# Assigns the label. This operation is immutable during the preview.62$labelBody = @{63 assignedLabels = @(64 @{ labelId = $LabelId }65 )66} | ConvertTo-Json -Depth 467 68Invoke-MgGraphRequest `69 -Method PATCH `70 -Uri "https://graph.microsoft.com/beta/groups/$($group.id)" `71 -Body $labelBody `72 -ContentType "application/json"73 74# assignedLabels must be requested explicitly in the query.75$verifiedGroup = Invoke-MgGraphRequest `76 -Method GET `77 -Uri "https://graph.microsoft.com/beta/groups/$($group.id)?`$select=id,displayName,assignedLabels"78 79$assignedIds = @($verifiedGroup.assignedLabels | ForEach-Object { $_.labelId })80if ($assignedIds -notcontains $LabelId) {81 throw "The expected label is not visible on the group."82}83 84# The guest control must be tested with an account without a privileged role.85Disconnect-MgGraph | Out-Null86Write-Host "Sign in again with a non-privileged test account."87Connect-MgGraph -Scopes @(88 "GroupMember.ReadWrite.All",89 "User.Read.All"90) -ContextScope Process91 92$guest = Invoke-MgGraphRequest `93 -Method GET `94 -Uri "https://graph.microsoft.com/v1.0/users/${GuestUserId}?`$select=id,userType"95 96if ($guest.userType -ne "Guest") {97 throw "The supplied user is not identified as a guest."98}99 100$memberBody = @{101 "@odata.id" = "https://graph.microsoft.com/v1.0/directoryObjects/$GuestUserId"102} | ConvertTo-Json103 104$guestAdded = $false105try {106 Invoke-MgGraphRequest `107 -Method POST `108 -Uri "https://graph.microsoft.com/v1.0/groups/$($group.id)/members/`$ref" `109 -Body $memberBody `110 -ContentType "application/json"111 112 $guestAdded = $true113 $testResult = "Guest addition allowed"114 115 if (-not $LabelAllowsGuests) {116 Write-Warning "Unexpected result: the label should have blocked the guest."117 }118}119catch {120 $testResult = "Addition refused: $($_.Exception.Message)"121 122 if ($LabelAllowsGuests) {123 Write-Warning "Unexpected result: the label should have allowed the guest."124 }125}126finally {127 # Removes the guest if the test succeeded, to leave a clean group.128 if ($guestAdded) {129 Invoke-MgGraphRequest `130 -Method DELETE `131 -Uri "https://graph.microsoft.com/v1.0/groups/$($group.id)/members/$GuestUserId/`$ref"132 }133}134 135[pscustomobject]@{136 GroupId = $group.id137 GroupDisplayName = $verifiedGroup.displayName138 AssignedLabelIds = $assignedIds -join ","139 GuestTestResult = $testResult140}First run the script with -DryRun. Then use -SyncOnly if the label has just been published, and wait for it to propagate before running the full scenario.
Verifying the label and guest control
Microsoft Graph does not return assignedLabels by default. You must request this property explicitly, with $select=assignedLabels in a REST request or -Property assignedLabels with a compatible Graph command. A response without this property therefore does not prove that the assignment failed.
Consider a group intended for internal resources. The team publishes a label that forbids guests, assigns it to an empty test group, then tries to add an external account. The refusal is expected, but it must be distinguished from a simple Graph permission problem.
The reverse test remains useful. A second label that allows guests confirms that the test account can normally modify membership. This comparison avoids blaming Purview for a refusal caused by an unrelated restriction.
Four limitations can skew the results
Administrative roles such as Global Administrator, User Administrator or Groups Administrator can bypass label enforcement during the preview. The same risk exists with application permissions such as Group.ReadWrite.All or Directory.ReadWrite.All. The functional test must therefore use a delegated sign-in and a user without a privileged role.
A Purview policy change does not remove guests who are already members. The protection acts at creation or first assignment, not as a permanent remediation engine.
Nested groups add another constraint. A group containing child groups cannot receive the label until those children have been removed. The labels of the children must also be at least as restrictive as that of the parent.
Finally, assignment is not offered in the Microsoft 365 admin centre or in My Groups. Microsoft recommends not modifying or deleting the policy of a label already used on security groups.
Frequently asked questions
Can a label be removed from an Entra security group?
Not during the preview. You must create a new group with the right label, move its members and switch dependencies over to the new group.
Are dynamic and synchronised groups compatible?
No. Dynamic membership groups and groups synchronised from on-premises Active Directory are excluded, as are Exchange-managed groups and mail-enabled groups.
Is enabling labels for Microsoft 365 groups enough?
No. Microsoft 365 groups use Group.Unified, whereas security groups require Group.Security with EnableMIPLabels set to True.
Why can an administrator still add a guest?
Certain privileged roles and certain application permissions bypass the control during the preview. Repeat the test with a non-privileged account and delegated authentication after waiting for replication.
Where to start
Recommended deployment plan
- Inventory the static cloud groups that can receive a label
- Define a test label that explicitly allows or blocks guests
- Check
Group.Securitybefore any synchronisation - Run
Execute-AzureADLabelSync, then respect the propagation delay - Run the script in
-DryRunmode on a disposable group - Check
assignedLabelsbefore testing guest access - Perform the test with a non-privileged account
- Document recreating the group as the only corrective procedure
If the organisation cannot easily recreate a wrongly labelled group, it should limit the preview to an isolated scope. A production deployment should only begin after validating dependencies, existing guests and the group replacement process.
Going further
- Assign sensitivity labels to Microsoft Entra security groups — prerequisites, limitations and troubleshooting for the preview.
- Container label support and Guest access controls for Entra ID Security Groups — analysis of
assignedLabelsand the minimal Graph scope. - Execute-AzureADLabelSync — reference for the synchronisation cmdlet.
- Use sensitivity labels to protect collaborative workspaces — configuring labels for groups and sites.



