To find sites allowing Anyone links in SharePoint Online, read each site's sharing setting and keep those set to Anyone, which PowerShell names ExternalUserAndGuestSharing. A site can't share more than the organisation allows, so if the organisation's setting isn't Anyone, no site allows these links. The setting says Anyone links can be made, not that any exist.
| Method | Best fit |
|---|---|
| PowerShell | A CSV of every site and OneDrive whose sharing setting is Anyone. |
| Admin centre | Sorting the sites by their sharing setting, and checking 1 person's OneDrive. |
| Altivane | Recommended for recurring reviews, with the organisation's sharing settings rated beside the list. |
Before you start
Use an account with the SharePoint Administrator role. To read a site with Get-SPOSite, Microsoft says the account must be a SharePoint Online administrator and a site collection administrator. In PowerShell 7 the SharePoint Online Management Shell must be loaded through Windows PowerShell, which the last line of the install block does.
Anyone links open without signing in, which is why they're worth a regular look. The settings are read live. The examples read and export and change nothing.
Option 1
Find sites allowing Anyone links with PowerShell
Install the module once, then connect, check the organisation's setting and read each site and OneDrive. The connection prompts you to sign in. Replace contoso with your tenant's name.
# Install once, if the module is not already installed.
Install-Module Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
# In PowerShell 7 only: load the module through Windows PowerShell.
Import-Module Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell$ErrorActionPreference = 'Stop'
Connect-SPOService -Url 'https://contoso-admin.sharepoint.com'
try {
$anyone = 'ExternalUserAndGuestSharing'
$tenant = Get-SPOTenant
if ($tenant.SharingCapability -ne $anyone) {
Write-Output "The organisation's setting is $($tenant.SharingCapability)."
Write-Output 'No site can allow Anyone links.'
} else {
# -Limit does not fill SharingCapability, so read each site again by its address.
$list = Get-SPOSite -Limit All -IncludePersonalSite $true
$sites = @(foreach ($url in $list.Url) { Get-SPOSite -Identity $url })
$open = @($sites | Where-Object { $_.SharingCapability -eq $anyone })
if ($open.Count -eq 0) {
Write-Output 'No site or OneDrive allows Anyone links.'
} else {
$open | Sort-Object Url | Select-Object Url, Title, Template, Owner, SharingCapability |
Export-Csv -Path './anyone-links.csv' -NoTypeInformation -Encoding utf8
Write-Output "$($open.Count) sites and OneDrives allow Anyone links."
}
}
} finally {
Disconnect-SPOService
}Microsoft says that when -Limit or -Filter is used, SharingCapability isn't populated and may hold a default value, so the script lists the sites first and then reads each one by its address. That is slow on a large tenant. -IncludePersonalSite $true adds every OneDrive; take it out to read SharePoint sites only, or add -Template GROUP#0 in its place for group-connected sites.
Option 2
Review sharing settings in the admin centre
- Sign in to the SharePoint admin centre as a SharePoint Administrator.
- Expand Policies, select Sharing and read External sharing for SharePoint and OneDrive. If neither is Anyone, no site or OneDrive allows Anyone links.
- Go to Sites > Active sites. If the External sharing column isn't shown, add it to the list's columns.
- Sort or filter by External sharing to bring the sites set to Anyone together.
- For 1 person's OneDrive, in the Microsoft 365 admin centre go to Users > Active users, select the person, select the OneDrive tab and then Manage external sharing. Close it without saving.
This suits a look at the sites in Microsoft's own wording. OneDrives aren't in the Active sites list, so checking them means opening each person's, and for those PowerShell or Altivane is quicker.
Option 3 ยท Recommended for recurring reviews
Find sites allowing Anyone links with Altivane
- Open Altivane and choose the tenant.
- Run the SharePoint Sharing report.
- Open the tenant's Excel workbook and find Sites Allowing Anyone Links: each site and OneDrive whose sharing allows Anyone links, with its address, kind and owners.
- To export the same list on a schedule, or lower those sites' sharing when you choose to, use the Review Sites Allowing Anyone Links sample workflow.
The report needs a tenant signed in with a certificate. It also rates the organisation's sharing settings in SharePoint Settings to Review, each with the recommended value and the reason, and lists SharePoint Guests.
Contact usCommon questions
Does Anyone on a site mean files are shared publicly?
No. It means people on that site can create links that open without signing in. Whether any exist depends on what people have shared. Microsoft lets you make Anyone links expire after a set number of days, or give view access only.
Why does a site show Anyone when I set it lower?
Check which setting you changed. The organisation's setting is the ceiling for every site, and each site can be the same or lower, never higher. A OneDrive follows the OneDrive setting, which can be lower than SharePoint's but not higher.
How do I see the rest of the sharing settings?
Anyone links are 1 part of external sharing. For the organisation's and each site's full sharing settings, see how to check external sharing settings in SharePoint Online.
Microsoft references
Technical references checked on 6 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.