Disabling guest access for one team

Guest access is on in your organisation, but for one team, such as Board, HR or Payroll, you don't want external people. Turning off guest access for the whole tenant is too blunt: other teams do work with customers and partners. Fortunately you can block guests per team. Without PowerShell you do that with a sensitivity label in Microsoft Purview; with PowerShell you set a property on that one group. This article covers both, and what to watch out for.

Updated on 22 October 2026. Expanded with the one-time activation of labels for groups and sites, the exact label setting, the full Microsoft Graph PowerShell script, what happens to existing guests and the SharePoint site, common problems and a short FAQ.

How does it work?

Every team runs on a Microsoft 365 group. Whether owners can add guests is a property of that group: AllowToAddGuests. A sensitivity label sets that property for you, and you simply pick the label in Teams. For who can do what in a team, see owners, members and guests in Microsoft Teams.

One time: enable labels for groups and sites

By default, sensitivity labels only apply to files and emails. For teams, an admin has to enable them once:

  1. In Microsoft Entra ID, set the group setting EnableMIPLabels to True (with Microsoft Graph PowerShell).
  2. Connect to Security & Compliance PowerShell and run Execute-AzureAdLabelSync.

Until that's done, you'll see the group and site settings in the label wizard, but you can't select them.

With a sensitivity label (no PowerShell)

  1. Go to purview.microsoft.com > Information protection > Sensitivity labels > Create a label, for example Internal - no guests.
  2. Choose Groups & sites as the scope (optionally alongside Files & emails).
  3. In the protection settings for groups and sites, choose Privacy and external user access settings.
  4. Under External user access, untick Let Microsoft 365 group owners add people outside your organization to the group as guests. Optionally set privacy to Private.
  5. Publish the label with a label policy for the users who create or manage teams.
  6. Wait at least an hour. Then pick the label in Teams under Manage team > Settings > Sensitivity, or when creating a new team.

The exact option names can differ slightly between versions of the Purview portal. If you later change the group settings of a label already in use, allow about 24 hours for every team to pick it up.

Choosing a sensitivity label to disable guest access for one team

Licence

Applying sensitivity labels to groups requires Microsoft Entra ID P1 and a licence with Purview information protection, such as Microsoft 365 Business Premium, E3 or E5.

With PowerShell

Without labels, set AllowToAddGuests to false for that one group. Microsoft uses the beta Microsoft Graph PowerShell module for this:

Connect-MgGraph

$templateId = (Get-MgBetaDirectorySettingTemplate | ? {$_.DisplayName -eq "Group.Unified.Guest"}).Id

$groupId = (Get-MgBetaGroup -Filter "DisplayName eq 'Board'").Id

$params = @{ templateId = $templateId; values = @(@{ name = "AllowToAddGuests"; value = "false" }) }

New-MgBetaGroupSetting -GroupId $groupId -BodyParameter $params

It works, but it's harder to manage than a label: Teams doesn't show which teams are set this way, and you have to adjust every new team yourself.

Existing guests and the SharePoint site

Check it

As an owner, try adding an external address via Add member. Teams no longer allows it and says guests aren't permitted.

Common problems

FAQ

Can I turn off guest access for the whole organisation?

Yes, but that's a tenant setting. Read check and manage guest access in Teams.

What if a team needs guests later?

Assign a different label. With PowerShell, set the value back to true. For ongoing control, see technical governance for Microsoft Teams.

Nederlandstalige versie: Gasttoegang uitschakelen voor één team in Microsoft Teams


Related articles