How to make SharePoint “Anyone” links expire within 30 days

Set "Anyone" links to expire within 30 days.

Every Microsoft 365 security check · Collaboration & Sharing · NL-SPO-104

What this check looks at

Where "Anyone" links are allowed, checks that they stop working within 30 days.

"Anyone" links open a file or folder with no sign-in. Where the sharing level allows them, RequireAnonymousLinksExpireInDays decides how many days they keep working; 0 means they never expire, which is how Microsoft ships it.

The check reads the setting from the SharePoint admin API as ConfigCheckup Automation, only where the client granted it Sites.FullControl.All, and only ever reads it. It passes when Anyone links are not allowed at all, or expire within 30 days, and fails otherwise; a link that never expires is high severity.

Why it matters

An "Anyone" link needs no sign-in. One that never expires keeps working for whoever finds it in an old email, chat or forwarded message, long after the work it was for has ended.

An Anyone link keeps working for whoever finds it: in an old email thread, a chat or a forwarded message, months after the work it was made for has finished and long after anyone remembers it exists.

CISA SCuBA MS.SHAREPOINT.3.1v1 asks for Anyone links to expire within 30 days. Links made before the change keep their own expiry, so the old ones need looking at too.

How to fix it

Where: SharePoint admin centre → Policies → Sharing

Before you start

  • Links made before the change keep their own expiry: find long-lived Anyone links in Shared with anyone, or the sharing reports, and decide which to remove.
  • Tell users what is changing and when, with a contact for problems.

Step by step

  1. Tell people what changes. Tell staff, and site owners who share a lot with partners, that new "Anyone" links will stop working after the number of days set, the date it changes and who to ask about it.
  2. Set an expiry for Anyone links. In the SharePoint admin centre (https://<tenant>-admin.sharepoint.com), go to Policies > Sharing, and under "Choose expiration and permissions options for Anyone links" tick "These links must expire within this many days" and enter 30 or fewer. Select Save. Or: Set-SPOTenant -RequireAnonymousLinksExpireInDays 30.
  3. Deal with links made before. Links made before the change keep their own expiry. Shared with anyone lists the files in OneDrives and group libraries that anyone can open; remove the links nobody needs any more.
  4. Check it took effect. A new Anyone link shows its expiry date in the Share dialog. Get-SPOTenant | Select-Object RequireAnonymousLinksExpireInDays shows 30 or fewer, and the next assessment passes.

With PowerShell

Connect-SPOService -Url https://<tenant>-admin.sharepoint.com
Set-SPOTenant -RequireAnonymousLinksExpireInDays 30

What users will notice

New "Anyone" links stop working after the number of days set; people make a new link when they still need one.

How to confirm it worked

Get-SPOTenant | Select-Object RequireAnonymousLinksExpireInDays shows 30 or fewer; a new Anyone link shows its expiry date.

Frameworks and controls

This check maps to controls in 13 frameworks. Passing it is evidence that the setting is in place, not a certification against any of them.

The frameworks and controls NL-SPO-104 maps to
FrameworkControl
NCSC CAFB3.c Stored data
DSPTStandard 1: Personal confidential data
DORAArt. 9(4)(c) Limiting logical access to what is required
NIS2Art. 21(2)(i) Access control and asset management
Zero TrustData
SOC 2CC6.7 Restricting the transmission, movement and removal of information
NIST SP 800-1713.1.22 Control CUI posted or processed on publicly accessible systems
CMMC Level 2AC.L2-3.1.22 Control Public Information
ISO 27001:2022A.5.14 Information transferA.5.18 Access rights
CISA SCuBAMS.SHAREPOINT.3.1v1 Anyone links expire within 30 days
CIS Controls v8.13.3 Configure data access control lists (IG1)
NIST CSF 2.0PR.AA-05: Access permissions, entitlements, and authorizations are defined in a policy, managed, enforced, and reviewed, and incorporate the principles of least privilege and separation of duties
NCSC 10 StepsData security

The framework mappings were last checked against the published standards in October 2026.

Further reading

The full Microsoft 365 security checklist, worst first

ConfigCheckup

Check this in every tenant.

ConfigCheckup runs this check on every tenant you connect and gives you a step-by-step fix guide. The next assessment confirms the fix.

14 days of daily monitoring and alerts, every finding with its fix guide, and reports on up to 3 tenants, from your first connected tenant. No card. Then choose the plan that fits.Where this check fits: Microsoft 365 security assessment for MSPs