In this module

AD4.6 SharePoint External Sharing Controls

5-6 hours · Module 4 · Free
Operational Objective
SharePoint Online and OneDrive for Business are the primary file sharing platforms in M365. By default, users can share files and folders with anyone — internally and externally — with a single click. The "Anyone with the link" sharing option creates anonymous links that don't require authentication, meaning any person who obtains the link can access the content. A user who intends to share a single document with a vendor may accidentally share an entire folder, or create a link that's valid indefinitely and accessible without a login. SharePoint external sharing controls tighten these defaults: restricting who users can share with, requiring authentication for external access, setting link expiration, and blocking sharing from sites that contain sensitive content. This subsection configures sharing controls at the tenant level and the site level — preventing accidental oversharing while preserving legitimate external collaboration.
Deliverable: SharePoint and OneDrive external sharing tightened from default to controlled — anonymous links disabled, authenticated sharing only, link expiration set, and sensitive sites restricted from external sharing entirely.
Estimated completion: 25 minutes
SHAREPOINT SHARING LEVELS — FROM MOST TO LEAST PERMISSIVE ANYONE Anonymous links — no login Anyone with the URL can access No audit trail for who accessed DEFAULT — most organizations Disable this NEW + EXISTING GUESTS External users must authenticate Users can invite new external people Guest accounts created in Entra ID Audit trail: who accessed, when RECOMMENDED for most orgs EXISTING GUESTS ONLY Only guests already in Entra ID Users can't invite new externals Admin controls guest list More restrictive but manageable Good for regulated environments INTERNAL ONLY No external sharing at all Most restrictive Blocks all guest collaboration Use per-site for sensitive content Per-site for HR, Finance, Legal

Figure AD4.6 — SharePoint sharing levels. "Anyone" (anonymous links) is the default and should be disabled. "New and existing guests" (authenticated sharing) is the recommended tenant-level setting. "Existing guests only" and "Internal only" are used per-site for sensitive content.

Configuring tenant-level sharing

Navigate to admin.microsoft.com → SharePoint → Sharing (or sharepoint.com/_layouts/15/online/AdminHome.aspx#/sharing).

External sharing level: Change from "Anyone" to "New and existing guests." This disables anonymous links and requires external recipients to authenticate with a Microsoft account, a work account, or a one-time passcode. Every external access is now associated with an identity and logged in the audit trail.

Default sharing link type: Change to "Only people in your organization." This means when a user clicks "Share" in SharePoint or OneDrive, the default link scope is internal-only. They can still change it to share externally, but they have to deliberately choose "Specific people" and enter the external email address. The accidental "share with everyone" scenario is eliminated.

Default link permissions: Change to "View" (read-only). External recipients get view-only access by default — they have to be explicitly granted edit access. This prevents accidental "anyone can edit" shares.

Expiration for guest access links: Set to 30 days. External sharing links expire after 30 days. If the vendor still needs access, the user must re-share — creating a natural review cycle for external access.

Apply these settings via PowerShell for documentation and repeatability:

Connect-SPOService -Url https://northgateeng-admin.sharepoint.com

Set-SPOTenant -SharingCapability ExternalUserSharingOnly `
    -DefaultSharingLinkType Internal `
    -DefaultLinkPermission View `
    -RequireAnonymousLinksExpireInDays 30 `
    -ExternalUserExpireInDays 30 `
    -RequireAcceptingAccountMatchInvitedAccount $true `
    -PreventExternalUsersFromResharing $true

The last two settings are important: RequireAcceptingAccountMatchInvitedAccount ensures the person accepting the share invitation is the same person who was invited (preventing share-link forwarding). PreventExternalUsersFromResharing prevents an external guest from sharing your content with additional external people — the share chain stops at one level.

Configuring site-level sharing restrictions

Tenant-level sharing sets the maximum. Individual sites can be MORE restrictive than the tenant, but never less. For sensitive sites (HR, Finance, Legal, Executive), disable external sharing entirely.

Navigate to admin.microsoft.com → SharePoint → Active sites → select the sensitive site → Sharing → change to "Only people in your organization."

In PowerShell:

# Disable external sharing for sensitive sites
Set-SPOSite -Identity "https://northgateeng.sharepoint.com/sites/HR" `
    -SharingCapability Disabled
Set-SPOSite -Identity "https://northgateeng.sharepoint.com/sites/Finance" `
    -SharingCapability Disabled
Set-SPOSite -Identity "https://northgateeng.sharepoint.com/sites/Legal" `
    -SharingCapability Disabled

Verify the settings:

Get-SPOSite -Identity "https://northgateeng.sharepoint.com/sites/HR" |
    Select-Object Url, SharingCapability
# Should show: Disabled

For sites that need controlled external sharing (a project collaboration site with a specific vendor), set the site-level sharing to "Existing guests only" and pre-add the vendor's guest accounts to Entra ID. This gives controlled external access to specific, pre-approved partners without allowing ad-hoc sharing with anyone.

Auditing current external sharing

Before tightening sharing controls, audit what's currently shared externally. You need to know what will break — just like the compliance audit in Module AD3.

# Find all externally shared content across your tenant
Get-SPOSite -Limit All | ForEach-Object {
    $extUsers = Get-SPOExternalUser -SiteUrl $_.Url -ErrorAction SilentlyContinue
    if ($extUsers.Count -gt 0) {
        Write-Host "$($_.Url): $($extUsers.Count) external users" -ForegroundColor Yellow
        $extUsers | Select-Object DisplayName, Email, AcceptedAs, WhenCreated |
            Format-Table -AutoSize
    }
}

This shows every site with external users and who those users are. Review the list: are these legitimate collaborations (vendor project sites, client portals) or stale sharing from years ago? Stale external shares are access that nobody needs anymore but nobody revoked — each one is a potential data exposure path. Remove stale external users before tightening the controls.

OneDrive sharing controls

OneDrive shares the tenant-level sharing settings, but you can also set OneDrive-specific restrictions. Navigate to admin.microsoft.com → SharePoint → Sharing → OneDrive.

The most important OneDrive setting: Sync restrictions. By default, users can sync any SharePoint or OneDrive content to their local machine using the OneDrive sync client. This creates local copies of corporate data — including Confidential documents — on the user's laptop. If the laptop is lost, the local copies are accessible (BitLocker protects the drive, but if BitLocker is bypassed or the user logs in and the drive is decrypted, the files are exposed).

For high-security environments, restrict OneDrive sync to managed devices only:

Set-SPOTenant -OneDriveRequestManagedDevice $true

This prevents users from syncing OneDrive content on personal, unmanaged devices. The content remains accessible through the browser (which doesn't create local copies) but can't be synced offline. For most organizations with device compliance (Module AD3), this setting is appropriate because all managed devices have BitLocker — the synced files are encrypted at rest.

Verifying sharing controls after configuration

After tightening sharing controls, run a verification check to confirm the settings are applied:

Connect-SPOService -Url https://northgateeng-admin.sharepoint.com

# Tenant-level verification
$tenant = Get-SPOTenant
Write-Host "=== TENANT SHARING ===" -ForegroundColor Cyan
Write-Host "Sharing level: $($tenant.SharingCapability)"
Write-Host "Default link type: $($tenant.DefaultSharingLinkType)"
Write-Host "Default permission: $($tenant.DefaultLinkPermission)"
Write-Host "Link expiration: $($tenant.RequireAnonymousLinksExpireInDays) days"
Write-Host "Require matching account: $($tenant.RequireAcceptingAccountMatchInvitedAccount)"
Write-Host "Prevent resharing: $($tenant.PreventExternalUsersFromResharing)"

# Site-level verification for restricted sites
foreach ($site in @("HR","Finance","Legal")) {
    $s = Get-SPOSite -Identity "https://northgateeng.sharepoint.com/sites/$site"
    Write-Host "`n$site site: $($s.SharingCapability)" -ForegroundColor Yellow
}

Every setting should match your configuration from this subsection. Run this verification quarterly as part of the sharing audit — settings can be inadvertently changed by other admins or by Microsoft updates.

Removing stale external access

For each stale external user identified in the audit, remove their access:

# Remove a specific external user from a site
Remove-SPOExternalUser -UniqueIDs (Get-SPOExternalUser -SiteUrl "https://northgateeng.sharepoint.com/sites/ProjectAlpha" |
    Where-Object { $_.Email -eq "vendor@oldpartner.com" }).UniqueId

For bulk removal of all external users from a site after a project ends:

$siteUrl = "https://northgateeng.sharepoint.com/sites/CompletedProject"
$externalUsers = Get-SPOExternalUser -SiteUrl $siteUrl
foreach ($user in $externalUsers) {
    Remove-SPOExternalUser -UniqueIDs $user.UniqueId
    Write-Host "Removed: $($user.Email)"
}

Document each removal with the audit trail demonstrates active access management — evidence for GDPR compliance and for any access review audit.

The quarterly sharing audit

Schedule a quarterly review of external sharing — add it to the same calendar entry as the quarterly security report (AD7.5). The audit has three parts:

Part 1: External user inventory (5 minutes). Run Get-SPOExternalUser across all sites. Count total external users. Compare to last quarter — a significant increase without corresponding business justification (new vendor project, partnership expansion) suggests uncontrolled sharing growth.

Part 2: Stale access removal (10-15 minutes). For each external user, check: is the project or relationship still active? If not, remove access. Common stale patterns: vendors from completed projects, former consultants, one-time collaborators who received access 6+ months ago. A healthy environment removes 10-20% of external users each quarter through natural project completion.

Part 3: Site-level setting verification (5 minutes). Run the verification script above to confirm tenant and site-level settings haven't drifted. Check that HR, Finance, and Legal sites still have external sharing disabled. Check that the tenant default is still "New and existing guests" and not "Anyone." Settings drift happens when another admin changes a setting during troubleshooting and forgets to revert it.

Record the quarterly audit results in a simple log:

SHAREPOINT SHARING AUDIT — Q2 2026
Date: [date]
External users: 47 (last quarter: 52)
Stale users removed: 8
Sites with sharing disabled: HR ✓, Finance ✓, Legal ✓
Tenant sharing level: ExistingExternalUserSharingOnly ✓
Default link type: Internal ✓
Settings drift detected: None

This log feeds into the quarterly security report (AD7.5, Section 5) and provides evidence for any data protection audit.

OneDrive sharing — the personal site risk

OneDrive for Business is a SharePoint site collection per user. Every sharing control that applies to SharePoint also applies to OneDrive — but users have more autonomy over their personal OneDrive. The risk: a user shares their entire OneDrive root folder externally, exposing every document they've stored.

The tenant-level OneDrive sharing setting inherits from the SharePoint setting you configured above. Verify it explicitly:

$tenant = Get-SPOTenant
Write-Host "OneDrive sharing: $($tenant.OneDriveDefaultShareLinkScope)"
Write-Host "OneDrive default link type: $($tenant.OneDriveDefaultLinkPermission)"

If these values show "Anyone" or "Edit," tighten them to match the tenant defaults — "Internal" and "View." Users can still share externally by choosing authenticated sharing, but the default protects against accidental oversharing.

Compliance Myth: "We can't disable anonymous sharing because our users need to share with external partners"
Anonymous sharing (Anyone with the link) is not required for external collaboration. Authenticated sharing (New and existing guests) provides the same functionality — external users can access shared content — but requires them to verify their identity. The only difference: the external user sees a one-time passcode prompt or a Microsoft login page instead of accessing content anonymously. The collaboration experience is the same. The security improvement is significant: every access is authenticated, logged, and auditable. No legitimate business use case requires anonymous access — it's a convenience that creates risk without providing value that authenticated sharing doesn't also provide.
Decision point

After disabling anonymous links at the tenant level, the marketing team reports that their public-facing SharePoint site (used for distributing product datasheets to potential customers) no longer works — customers can't download datasheets without logging in. The marketing team argues that requiring authentication for public marketing materials is an unnecessary barrier. What do you do?

Option A: Re-enable anonymous links at the tenant level.

Option B: Keep anonymous links disabled at the tenant level. For the marketing site specifically, change its site-level sharing to "Anyone" — this is more permissive than the tenant default but only applies to this one site. Verify that the marketing site contains only public marketing materials (no internal documents, no customer data) before enabling anonymous sharing on it.

The correct answer is Option B. The marketing use case is legitimate — public datasheets should be accessible without authentication. The solution is per-site, not tenant-wide. The marketing site gets "Anyone" sharing because its content is genuinely public. Every other site uses the tenant-level "New and existing guests" setting that requires authentication. Before enabling anonymous sharing on the marketing site, audit its content to ensure no internal or confidential documents have been accidentally uploaded to it.

Try it: Tighten your SharePoint sharing controls

1. Check current state: Run Get-SPOTenant | Select SharingCapability, DefaultSharingLinkType, DefaultLinkPermission and record the results.

2. Audit external sharing: Run the external user audit script to identify all sites with external users. Review the list for stale shares.

3. Tighten tenant sharing: Set the tenant to "New and existing guests" with internal-only default links, view-only default permissions, and 30-day link expiration.

4. Lock sensitive sites: Set HR, Finance, and Legal sites to "Disabled" (no external sharing).

5. Verify: Try creating a sharing link from a normal site — the default should be "People in Northgate Engineering" (internal only). Try sharing from the HR site — external sharing should be blocked entirely.

6. Test external sharing: Share a document from a non-restricted site with a personal email address. The recipient should receive an invitation email, authenticate (one-time passcode or Microsoft account), and then access the document. The experience should be smooth for the external user — just with authentication instead of anonymous access.

A user in the engineering department shares a SharePoint folder with a vendor by entering the vendor's email address. The vendor authenticates and accesses the folder. Inside the folder, there's a subfolder containing HR documents that were accidentally moved there by another user. Can the vendor access the HR documents?
No — the HR documents have the "Confidential" sensitivity label with encryption, so the vendor can't open them even though they have folder access — Correct only if the documents are labeled and encrypted. But the question doesn't confirm they are. If the HR documents have no label or are labeled "Internal" (which has no encryption), the vendor CAN access them.
Yes — folder-level sharing grants access to all content within the folder, including subfolders. The vendor can access the HR documents unless they have encryption (Confidential or Highly Confidential label) that blocks external access — Correct. This is exactly the oversharing scenario that sensitivity labels prevent. SharePoint folder sharing grants access to all content in the folder tree. Without encryption on the HR documents, the vendor sees everything. This is why sensitivity labels with encryption are essential ALONGSIDE sharing controls — they protect individual documents regardless of the folder-level sharing.
No — the HR site has external sharing disabled — The HR documents are not in the HR site. They were accidentally moved to the engineering folder. Site-level sharing controls don't follow documents when they're moved between sites.
SharePoint automatically detects HR content and blocks external access — Not without DLP or sensitivity labels. SharePoint doesn't inspect document content for sensitivity by default.

You're reading the free modules of M365 Security: From Admin to Defender

The full course continues with advanced topics, production detection rules, worked investigation scenarios, and deployable artifacts.

View Pricing See Full Syllabus