Lock Down SharePoint and OneDrive External Sharing
Most accidental data exposure in Microsoft 365 is a sharing link, not a hack. SharePoint and OneDrive sharing is set at the organization level, and each site can only be the same or stricter. This guide picks a sensible organization level, limits Anyone links, sets the default link type, and opens sharing only on the sites that need it.
Before you start
- Role: SharePoint Administrator (Manage sharing settings (opens in a new tab)).
- Know the defaults: OneDrive defaults to Anyone, group-connected sites (including Teams) default to New and existing guests when group owners can add outside people, and classic, communication and modern no-group sites default to Only people in your organization. The root communication site defaults to Anyone (Default site sharing settings (opens in a new tab)).
- Guests in Microsoft Entra ID: with Microsoft Entra B2B integration, sharing creates a guest account and your Entra external collaboration settings apply (B2B integration (opens in a new tab)). See Guest (B2B) users and Guest access cleanup.
Step by step
- Set the organization level. In the SharePoint admin center, go to Policies > Sharing and set the External sharing level for SharePoint and for OneDrive. The OneDrive setting can be stricter than SharePoint but not more permissive (Organization-level setting (opens in a new tab)). New and existing guests requires people to sign in or use a verification code; Existing guests only allows guests already in your directory (External sharing options (opens in a new tab)).
- If you keep Anyone links, limit them. Require Anyone links to expire within a set number of days and restrict them to View (Advanced settings for Anyone links (opens in a new tab)).
- Set the default link type. Under File and folder links, choose Specific people (most restrictive) or Only people in your organization instead of Anyone with the link (More external sharing settings (opens in a new tab)).
- Add guardrails. Under More external sharing settings, you can limit sharing to listed domains (up to 5,000), allow only specific security groups to share externally, and make guest access to a site or OneDrive expire after a number of days (More external sharing settings (opens in a new tab)).
- Open up per site. In Active sites, select a site, then Settings > More sharing settings, and pick a level up to the organization’s. You can also set domain limits, guest expiration and default links per site (Change a site’s setting (opens in a new tab)).
Gotchas
- The SharePoint setting applies to every site type, including group- and Teams-connected sites, and Groups and Teams guest settings also affect those sites (Organization-level setting (opens in a new tab)).
- Restricting or turning off sharing typically removes guest access within one hour. If you turn sharing off for the organization and later back on, guests regain access, so turn off the specific sites first if you don’t want that (External sharing options note (opens in a new tab)).
- Microsoft Entra external collaboration settings decide who can invite guests for site sharing, and Entra allowed or blocked domains also apply (Important note (opens in a new tab), Domain limits (opens in a new tab)).
- File requests need OneDrive set to Anyone with edit permission for Anyone links (External sharing options (opens in a new tab)).
- By default, guests need full control to share items externally (More external sharing settings (opens in a new tab)).
Check it worked
- From a test user’s OneDrive, open Share: the default link should be the type you chose, and Anyone should be missing or show your expiry.
- Open a site in Active sites and confirm its sharing level shows what you set.
Roll back
Set the organization or site sharing level back to the previous option and save. Remember that loosening sharing again can restore guests’ access to content they had before (External sharing options note (opens in a new tab)).
Related on EntraReady: Guest access cleanup, Teams external access vs guest access, Guest access reviews, and Cross-tenant access settings.
Sources (Microsoft Learn): Manage sharing settings for SharePoint and OneDrive (opens in a new tab), Change the sharing settings for a site (opens in a new tab).
← All GuidesIs this still accurate?
Spotted something outdated or wrong on this page? Tell us in a sentence. The page address is sent with it.