Sites allowing "Anyone" links
A SharePoint site that allows "Anyone" links lets people share files with anyone who holds the link, without that person signing in. You can check the tenant-wide ceiling with one read-only Microsoft Graph call, then review the sites that sit at that level.
Why it matters
An "Anyone" link grants access to whoever has the URL, and the link can be forwarded, so you cannot tell who actually opened the file. Microsoft documents that the organization-level external sharing setting is the upper limit for every site: a site can be set to the same level or a stricter one, never a more permissive one (Microsoft Learn: Manage sharing settings for SharePoint and OneDrive). If the tenant allows "Anyone", any site that has not been tightened can create these links.
Find it yourself
This script is read-only: it only sends a GET request and changes nothing in your tenant. It reads the tenant-wide sharing capability from the SharePoint settings resource (Microsoft Learn: sharepointSettings).
Connect-MgGraph -Scopes "SharePointTenantSettings.Read.All"
$settings = Invoke-MgGraphRequest -Method GET `
-Uri "https://graph.microsoft.com/v1.0/admin/sharepoint/settings"
$settings.sharingCapability
Disconnect-MgGraphPer-site sharing levels are not part of this call. Open the SharePoint admin center, go to Active sites and read the external sharing setting for each site.
Read the result
The value externalUserAndGuestSharing is the "Anyone" level: the tenant allows links that work without sign-in. The other values are stricter: externalUserSharingOnly (new and existing guests), existingExternalUserSharingOnly (existing guests only) and disabled (only people in your organization). If the tenant is not at the "Anyone" level, no site can allow "Anyone" links. If it is, list the sites in the admin center and note which ones are also set to "Anyone".
What to do next
For each site that allows "Anyone" links, decide whether it needs them. Where it does not, lower the site to a stricter sharing level in the SharePoint admin center. If no site needs them, consider lowering the tenant-wide setting as well. Before you tighten a site, check which existing links people still rely on, since changing the level affects how those links work.
See it continuously
ConfigCobra's Microsoft 365 inventory includes a built-in risk view for sites allowing "Anyone" links. Findings are linked to the inventory objects they concern, and you can export the view as CSV. Scheduled scans (daily, weekly or monthly) and ad hoc scans keep it current, and email notifications tell you about drift. ConfigCobra is read-only and never changes your tenant.
Go further
- Inventory & InsightsEvery user, app, device and resource in one inventory, with built-in risk views
- Identity & Access GovernanceFind inactive users, guests, admins and risky apps
- Microsoft 365CIS v7.0.0 · 160 controls · read-only Microsoft Graph
- Users inactive 90 daysMicrosoft 365 insight
- Users who never signed inMicrosoft 365 insight
- Users with no MFA registeredMicrosoft 365 insight
- External mail forwardingMicrosoft 365 insight
See it for your whole tenant, continuously
Inventory & Insights lists these risks with built-in views and CSV export, read-only.