You set a sharing expiration date in the SharePoint admin center, but existing sharing links continue to work past that date. This happens because the expiration policy only applies to new links created after the policy is saved. This article explains why the policy does not retroactively affect existing links and provides the exact steps to enforce expiration on current shared links.
Key Takeaways: Enforcing Expiration on Existing SharePoint Sharing Links
- SharePoint admin center > Policies > Sharing: Sets the default expiration window for new sharing links only.
- Existing links must be manually recreated or replaced: The expiration policy does not apply retroactively to links created before the policy was saved.
- Use a site-level sharing policy or a PowerShell script: To bulk-update or revoke existing links that violate your new expiration rule.
Why Expiration Dates Do Not Apply to Existing Sharing Links
SharePoint stores the expiration date inside each sharing link at the moment the link is created. When you set or change the default expiration period in the SharePoint admin center under Policies > Sharing, that change only applies to new links generated after the policy is saved.
Existing links retain their original creation timestamp and any expiration date that was assigned at that time. If the link was created before the policy existed, it has no expiration date at all. The policy system does not scan existing links and update them. This behavior is by design to prevent disruption of active sharing that users depend on.
The same limitation applies to the per-site expiration setting under Site settings > Sharing. Changing the site-level expiration window also only affects new links created from that moment forward.
Steps to Enforce Expiration on Existing Sharing Links
To force existing links to respect your new expiration policy, you must either replace them or remove them and ask users to reshare. Use the method that matches your scenario.
Method 1: Use the SharePoint Admin Center to Revoke All Existing Links
- Open the SharePoint admin center
Go to https://admin.microsoft.com and select SharePoint from the admin center list. Alternatively, go directly to https://admin.microsoft.com/SharePoint. - Navigate to Active sites
In the left navigation, click Active sites. A list of all site collections appears. - Select the site with existing links
Click the site name to open its details panel. Do not click the checkbox. Click the linked name. - Open the Sharing tab
In the site details panel, click the Sharing tab. This tab shows the current sharing settings for the site. - Set an expiration window
Under Expiration, select Set expiration for new sharing links and enter a number of days. This step ensures all new links will have an expiration, but does not affect existing links. - Revoke all existing sharing links
Scroll down to the Sharing links section. Click Revoke all sharing links. A confirmation dialog appears. Click Revoke. This action invalidates every sharing link on the site, including anonymous links and specific people links. - Notify users to reshare
After revocation, users must create new sharing links. Those new links will inherit the expiration policy you set in step 5.
Method 2: Use PowerShell to Bulk-Update Link Expiration
If you need to preserve some existing links but update their expiration dates, use the SharePoint Online Management Shell. This method requires the SharePoint Online Management Shell module.
- Install the SharePoint Online Management Shell
Open Windows PowerShell as an administrator and runInstall-Module -Name Microsoft.Online.SharePoint.PowerShell. If you already have the module, runUpdate-Module -Name Microsoft.Online.SharePoint.PowerShell. - Connect to SharePoint Online
RunConnect-SPOService -Url https://yourtenant-admin.sharepoint.com. Replaceyourtenantwith your tenant name. Sign in with a Global Admin or SharePoint Admin account. - Get the site URL
Identify the site URL where you want to update links. For example:https://yourtenant.sharepoint.com/sites/ProjectX. - Retrieve all sharing links
RunGet-SPOSiteSharingLink -SiteUrl "https://yourtenant.sharepoint.com/sites/ProjectX". This returns all sharing links on the site with their creation dates and current expiration. - Update the expiration for each link
Use a loop to set a new expiration date. For example, to set all links to expire in 30 days from the current date:Get-SPOSiteSharingLink -SiteUrl "https://yourtenant.sharepoint.com/sites/ProjectX" | ForEach-Object { Set-SPOSiteSharingLink -Identity $_.Id -ExpirationTime (Get-Date).AddDays(30) }
This command updates the expiration of every existing link to 30 days from today. - Verify the changes
RunGet-SPOSiteSharingLink -SiteUrl "https://yourtenant.sharepoint.com/sites/ProjectX"again and check theExpirationTimecolumn for each link.
If Expiration Still Does Not Apply After the Main Fix
Expiration Date Shows as Never but Policy Is Set
If you revoked all links and users created new ones but the expiration still shows as never, the site-level policy may not be enabled. Go to the site details panel in the SharePoint admin center, click the Sharing tab, and confirm that Set expiration for new sharing links is checked and a number of days is entered. Also check that the tenant-level policy under Policies > Sharing is set to the same or a shorter expiration period.
Anonymous Links Continue to Work
Anonymous links created before the policy change do not have an expiration date. The revocation method in Method 1 removes all anonymous links. If you only want to target anonymous links, use PowerShell with a filter: Get-SPOSiteSharingLink -SiteUrl "..." | Where-Object { $_.IsAnonymous -eq $true } and then apply the expiration update.
Users Report Link Broken Immediately After Revocation
Revoking all sharing links breaks every existing link on the site, including those the site owner may still need. To avoid this, use the PowerShell method to update expiration dates instead of revoking. If you must revoke, communicate the change to all site members before performing the action.
Tenant-Level vs Site-Level Expiration: Key Differences
| Item | Tenant-Level Policy | Site-Level Policy |
|---|---|---|
| Scope | All sites in the tenant | One specific site |
| Location in admin center | Policies > Sharing | Active sites > [site name] > Sharing tab |
| Applies to existing links? | No | No |
| Override behavior | Site-level policy overrides tenant-level if more restrictive | Site-level policy can be shorter or longer than tenant-level |
| Requires admin role | Global Admin or SharePoint Admin | Site collection admin or SharePoint Admin |
You can now enforce expiration dates on existing sharing links by either revoking all links and asking users to reshare or by using PowerShell to update the expiration of each link. For ongoing management, consider setting a tenant-wide default expiration period and educating site owners to create new links after policy changes. Use the PowerShell Set-SPOSiteSharingLink cmdlet to audit and update link expiration on a regular schedule without disrupting active sharing.