Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (2024)

  • Article

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (1) Some features in this article require Microsoft SharePoint Premium - SharePoint Advanced Management

You can restrict access to SharePoint sites and content to users in a specific group by using a site access restriction policy. Users not in the specified group can't access the site or its content, even if they had prior permissions or a shared link. This policy can be used with Microsoft 365 group-connected, Teams-connected, and non-group connected sites.

Site access restriction policies are applied when a user attempts to open a site or access a file. Users with direct permissions to the file can still view files in search results. However, they can't access the files if they're not part of the specified group.

Restricting site access via group membership can minimize the risk of oversharing content. For insights into data sharing, see Data access governance reports.

Prerequisites

The site access restriction policy requires Microsoft SharePoint Premium - SharePoint Advanced Management.

Enable site-level access restriction for your organization

You must enable site-level access restriction for your organization before you can configure it for individual sites.

To enable site-level access restriction for your organization in SharePoint admin center:

  1. Expand Policies and select Access control.

  2. Select Site-level access restriction.

  3. Select Allow access restriction and then select Save.

To enable site-level access restriction for your organization using PowerShell, run the following command:

Set-SPOTenant -EnableRestrictedAccessControl $true

It might take up to one hour for command to take effect

Note

For Microsoft 365 Multi-Geo users, run this command separately for each desired geo-location.

Restrict access to group-connected sites (Microsoft 365 Groups and Teams)

Site access restriction policy for group-connected sites restricts SharePoint site access to members of the Microsoft 365 group or team associated with the site.

To manage site access restriction for a group-connected site in SharePoint admin center

  1. In SharePoint admin center, expand Sites and select Active sites.
  2. Select the site you want to manage and the site details panel appears.
  3. In the Settings tab, select Edit in the Restricted site access section.
  4. Select the Restrict access to this site box and select Save.

To manage site access restriction for group-connected sites using PowerShell, use the following commands:

ActionPowerShell command
Enable site access restriction for group-connected siteSet-SPOSite -Identity <siteurl> -RestrictedAccessControl $true
View site access restriction for group-connected siteGet-SPOSite -Identity <siteurl> -Select RestrictedAccessControl
Disable site access restriction for group-connected siteSet-SPOSite -Identity <siteurl> -RestrictedAccessControl $false

Note

Once the policy is enabled for a site, the site owner can view the details of how the site access restriction policy affects the site.

For group-connected sites, the policy status and the configured control group details are displayed on the Site Information and Permissions panels.

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (3)

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (4)

Restrict site access to non-group connected sites

You can restrict access to non-group connected sites by specifying Entra security groups or Microsoft 365 groups that contain the people who should be allowed access to the site. You can configure up to 10 Entra security groups or Microsoft 365 groups. Once the policy is applied, users in the specified group who have site access permissions are granted access to the site and its content. You can use dynamic security groups if you want to base group membership on user properties.

To manage site access to a non-group connected site:

  1. In SharePoint admin center, expand Sites and select Active sites.

  2. Select the site you want to manage and the site details panel appears.

  3. In Settings tab, select Edit in the Restricted site access section.

  4. Select the Restrict SharePoint site access to only users in specified groups check box.

  5. Add or remove your security groups or Microsoft 365 groups and select Save.

    In order for site access restriction to be applied to the site, you must add at least one group to the site access restriction policy.

To manage site access restriction for non-group connected sites using PowerShell, use the following commands:

ActionPowerShell command
Enable site access restrictionSet-SPOSite -Identity <siteurl> -RestrictedAccessControl $true
Add groupSet-SPOSite -Identity <siteurl> -AddRestrictedAccessControlGroups <comma separated group GUIDS>
Edit groupSet-SPOSite -Identity <siteurl> -RestrictedAccessControlGroups <comma separated group GUIDS>
View groupGet-SPOSite -Identity <siteurl> Select RestrictedAccessControl, RestrictedAccessControlGroups
Remove groupSet-SPOSite -Identity <siteurl> -RemoveRestrictedAccessControlGroups <comma separated group GUIDS>
Reset site access restrictionSet-SPOSite -Identity <siteurl> -ClearRestrictedAccessControl

After enabling the policy for communication sites, the policy status and all configured control groups are displayed for site owners on the Site access panel in addition to the Site Information and Permissions panels.

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (6)

Shared and private channel sites are separate from the Microsoft 365 group-connected site that standard channels use. Because shared and private channel sites aren't connected to the Microsoft 365 group, site access restriction policies applied to the team don't affect them. You must enable site access restriction for each shared or private channel site separately as non-group connected sites.

For shared channel sites, only internal users in the resource tenant are subject to site access restriction. External channel participants are excluded from site access restriction policy and only evaluated per the site's existing site permissions.

Important

Adding people to the security group or Microsoft 365 group won't give users access to the channel in Teams. It is recommended to add or remove the same users of the teams channel in Teams and the security group or Microsoft 365 group so users have access to both Teams and SharePoint.

Sharing of sites with Restricted site access policy

Sharing of SharePoint sites and its content can be blocked with users and groups who are not allowed as per the Restricted access control policy.

The sharing control functionality is disabled by default. To enable it, run the following PowerShell command in SharePoint Online Management Shell as an Administrator:

Set-SPOTenant -AllowSharingOutsideRestrictedAccessControlGroups $false 

Sharing with users

Sharing is only allowed with users who are part of restricted access control groups. Sharing will be blocked with anyone outside of the restricted access control groups as shown below:

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (7)

Sharing with groups

Sharing is allowed with Microsoft Entra Security or M365 groups which are part of the restricted access control groups list. Thus, sharing with all other groups including Everyone except external users or SharePoint groups won’t be allowed.

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (8)

Note

At present, sharing of a site and its content will not be allowed for the nested security groups that are part of the restricted access control groups. This support will be added in the next release iteration.

Configure learn more link for access denial error page

Configure your learn more link to inform users who were denied access to a SharePoint site due to the restricted site access control policy. With this customizable error link, you can provide more information and guidance to your users.

Note

The learn more link is a tenant-level setting that applies to all sites that have restricted access control policy enabled.

To configure the link, run the following command in SharePoint PowerShell:

Set-SPOTenant -RestrictedAccessControlForSitesErrorHelpLink “<Learn more URL>” 

To fetch the value of the link, run the following command:

Get-SPOTenant | select RestrictedAccessControlForSitesErrorHelpLink 

The configured learn more link is launched when the user selects the Know more about your organization’s policies here link.

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (9)

Restricted site access policy insights

As an IT administrator, you can view the following reports to gain more insight about SharePoint sites protected with restricted site access policy:

  • Sites protected by restricted site access policy (RACProtectedSites)
  • Details of access denials due to restricted site access (ActionsBlockedByPolicy)

Note

It can take a few hours to generate each report.

Sites protected by restricted site access policy report (preview)

You can run the following commands in SharePoint PowerShell to generate, view, and download the reports:

ActionPowerShell commandDescription
Generate reportStart-SPORestrictedAccessForSitesInsights -RACProtectedSitesGenerates a list of sites protected by restricted site access policy
View reportGet-SPORestrictedAccessForSitesInsights -RACProtectedSites -ReportId <Report GUID>The report shows the top 100 sites with the highest page views that are protected by the policy.
Download reportGet-SPORestrictedAccessForSitesInsights -RACProtectedSites -ReportId <Report GUID> -Action DownloadThis command must be run as an administrator. The downloaded report is located on the path where the command was run.
Percentage of site protected with restricted site access reportGet-SPORestrictedAccessForSitesInsights -RACProtectedSites -ReportId <Report GUID> -InsightsSummaryThis report shows the percentage of sites that are protected by the policy out of the total number of sites

Access denials due to restricted site access policy

You can run the following commands to create, fetch, and view report for access denials due to restricted site access reports:

ActionPowerShell commandDescription
Create access denials reportStart-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicyCreates a new report for fetching access denial details
Fetch access denials report statusGet-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicyFetches the status of the generated report.
Latest access denials in the past 28 daysGet-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicy -ReportId <Report ID> -Content AllDenialsGets a list of the most recent 100 access denials that occurred in the past 28 days
View list of top users who were denied accessGet-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicy -ReportId <Report ID> -Content TopUsersGets a list of the top 100 users who received the most access denials
View list of top sites that received the most access denialsGet-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicy -ReportId <Report ID> -Content TopSitesGets a list of the top 100 sites that had the most access denials
Distribution of access denials across different types of sitesGet-SPORestrictedAccessForSitesInsights -ActionsBlockedByPolicy -ReportId <Report ID> -Content SiteDistributionShows the distribution of access denials across different types of sites

Note

To view up to 10,000 denials, you must download the reports. Run the download command as an administrator and the downloaded reports will be located on the path from where command was run.

Auditing

Audit events are available in the Purview compliance portal to help you monitor site access restriction activities. Audit events are logged for the following activities:

  • Applying site access restriction for site
  • Removing site access restriction for site
  • Changing site access restriction groups for site

Related articles

Conditional access policy for SharePoint sites and OneDrive

Data Access Governance reports

Restrict SharePoint site access with Microsoft 365 groups and Entra security groups - SharePoint in Microsoft 365 (2024)
Top Articles
What are the most profitable items to sell online? (excluding bulky items)
SoFi Active Investing vs. Webull: Which Broker Is Right for You? | The Motley Fool
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 5746

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.