Securely Share Files and Information in SharePoint Online

Published: Updated: 5 min readSharePoint Online
Securely Share Files and Information in SharePoint Online

Updated November 2026: rewritten for the current SharePoint admin center and Microsoft Purview, with new screenshots and PowerShell examples.

Sharing in SharePoint Online is controlled in layers. The organization-level setting sets the ceiling, each site can be tighter but never looser, and Microsoft Purview and Microsoft Entra ID add protection on top. Most oversharing problems come from leaving the defaults alone, so this guide walks through the settings I check first on any tenant, in the order I check them.

On this page

1. Decide who content can be shared with (organization level)

In the SharePoint admin center, go to Policies > Sharing. The two sliders set the most permissive sharing allowed for SharePoint and for OneDrive. OneDrive can never be more permissive than SharePoint.

SharePoint admin center Sharing page showing external sharing levels for SharePoint and OneDrive
Policies > Sharing: the organization-level ceiling for SharePoint and OneDrive
LevelWhat it allowsWhen to use it
AnyoneLinks that work without sign-inOnly if most content is not sensitive; always add expiry and view-only
New and existing guestsGuests must sign in or use a verification codeA good default for most organizations that work with partners
Existing guestsOnly guests already in Entra IDTight control, but guests can still be added outside SharePoint
Only people in your organizationNo external sharingInternal-only tenants or highly regulated sites

Microsoft’s own guidance (see Manage sharing settings for SharePoint and OneDrive) is to keep external sharing on rather than off, because people will otherwise fall back to email attachments and consumer file-sharing tools, which you can’t govern at all.

Further down the same page, under File and folder links, choose which link is selected by default when someone clicks Share. If Anyone links are allowed, don’t make them the default. Set the default to Specific people or Only people in your organization, set the default permission to View, and make Anyone links expire.

SharePoint admin center File and folder links settings with default link type, default permission and Anyone link expiration
Default link type, default permission and expiry for Anyone links

The same settings in PowerShell, using the SharePoint Online Management Shell:

Connect-SPOService -Url https://<tenant>-admin.sharepoint.com

# Allow guests who sign in, but no anonymous links
Set-SPOTenant -SharingCapability ExternalUserSharingOnly

# Default to "Specific people" links with view permission
Set-SPOTenant -DefaultSharingLinkType Direct -DefaultLinkPermission View

# If you do allow Anyone links: expire them after 30 days, view only
Set-SPOTenant -RequireAnonymousLinksExpireInDays 30 -FileAnonymousLinkType View -FolderAnonymousLinkType View

3. Tighten sharing on sensitive sites

The organization setting is only the ceiling. For HR, finance or legal sites, lower the sharing level per site: Sites > Active sites, select the site, then open the Settings tab.

SharePoint admin center site panel Settings tab with site external file sharing, sensitivity label, restrict content discovery and restricted site access
Site-level sharing, sensitivity label, Restricted Content Discovery and restricted site access

From the same panel you can also apply a sensitivity label to the site and, if you have SharePoint Advanced Management (included with Microsoft 365 Copilot licences), use two controls that matter a lot once Copilot is rolled out:

  • Restricted site access limits a site to members of a Microsoft 365 group or Entra security group, even if someone was shared a link earlier. See Restrict SharePoint site access.
  • Restricted Content Discovery keeps a site out of organization-wide search and Copilot results without changing permissions. It is meant as a temporary control while you review access. See Restrict discovery of SharePoint sites and content.

To find sites that are more open than you expect, list every site whose sharing level is higher than “Only people in your organization”:

Get-SPOSite -Limit All |
    Where-Object { $_.SharingCapability -ne 'Disabled' } |
    Select-Object Url, Title, SharingCapability, DefaultSharingLinkType |
    Sort-Object SharingCapability -Descending |
    Format-Table -AutoSize

# Lock a single site down to internal sharing
Set-SPOSite -Identity https://<tenant>.sharepoint.com/sites/hr -SharingCapability Disabled

4. Protect sensitive content with Microsoft Purview

Data loss prevention is not a SharePoint setting. It lives in Microsoft Purview > Data loss prevention > Policies and covers SharePoint, OneDrive, Exchange, Teams and Copilot from one place. A DLP policy can detect content such as card numbers or national ID numbers and block sharing it outside the organization, or show the user a policy tip first.

Microsoft Purview Data loss prevention create policy wizard showing financial data policy templates
Creating a DLP policy in Microsoft Purview from a template

Start from a template for your region, run it in simulation mode for a couple of weeks, review the matches, and only then turn on enforcement. Sensitivity labels (also in Purview) go one step further by encrypting files and controlling who can open them wherever they travel.

5. Control who can sign in, and from where

Multi-factor authentication and Conditional Access are configured in Microsoft Entra ID, not in SharePoint. For SharePoint the useful pieces are:

  • A Conditional Access policy that requires MFA for everyone, including guests.
  • Policies > Access control > Unmanaged devices in the SharePoint admin center to allow only web access (no download) from personal devices.
  • Authentication contexts to apply a stricter Conditional Access policy to individual sensitive sites.

6. Review sharing regularly

Settings drift. Site owners share with “Everyone except external users”, guests stay long after a project ends, and Anyone links live forever if you never set an expiry. Two things help:

  • Data access governance reports in the SharePoint admin center (Reports > Data access governance) show sites with the most sharing links, Anyone links and EEEU permissions.
  • Purview Audit records sharing events such as SharingSet and AnonymousLinkCreated, so you can see who shared what.

Quick checklist

  1. Organization sharing set to “New and existing guests” unless you have a reason to allow Anyone links.
  2. Default link type set to Specific people or People in your organization, with View permission.
  3. Anyone links (if allowed) expire and are view-only.
  4. Sensitive sites set to internal-only, labelled, and restricted where needed.
  5. A DLP policy in Purview, tested in simulation first.
  6. MFA for all users and guests through Entra Conditional Access.
  7. A monthly look at data access governance reports.
Share:
Adnan Amin

Adnan Amin

Adnan Amin is a Microsoft MVP for Microsoft 365 (since 2015) and a Senior Microsoft Consultant. He writes practical guides and PowerShell scripts for SharePoint, OneDrive, Teams and Copilot admins.

More posts by Adnan Amin

Leave a Reply

Your email address will not be published. Required fields are marked *