How to Configure the Per-Site Anyone Link Expiration Policy for SharePoint Online Sites

Customized Anyone Sharing Links on a Site-by-Site Basis

Office 365 notification MC186627 (roadmap item 53748) covers the introduction of a Per-Site Anyone Link Expiration Policy for SharePoint Online and OneDrive for Business sites. A clearer description might say that you can now configure different expiration dates for Anyone Sharing Links on a site-by-site basis, but only in PowerShell as there’s no GUI to assign a custom expiration period to a site. This functionality is available worldwide now.

Two things are at play here. First, the default period for sharing links. This setting applies to all sites in a tenant and is set in the Sharing section of the OneDrive for Business Admin portal (Figure 1).

Setting a default period for sharing links
Figure 1: Setting a default period for sharing links

Second, Anyone links. These sharing links are used to allow anyone (hence the name) who has the link to access files or folders in SharePoint Online or OneDrive for Business sites. Links like this are typically used to allow broad access to content that doesn’t need to be restricted, such as sharing publicity material with customers.

The Issue Being Addressed

The problem with a one-size fits all link expiration period is that it works perfectly well for some sites but not for others. Setting a 365-day expiration period is great for links used to access unrestricted content; it’s not so good if the link is used to give access to confidential material. Although these links are likely to be restricted to specific people, you still might want to have the links expire sooner than a year.

Set-SPOSite Has the Solution

To solve the problem, connect to SharePoint Online with PowerShell (using the latest available module). Find the URL for the site for which you want to set a custom Anyone link expiration period. You can run the Get-SPOSite cmdlet to return a list of sites or access the site and copy the URL from the browser address bar.

Now run the Set-SPOSite cmdlet to set the policy (Figure 2).

Running Set-SPOSite to set the Anyone link expiration period for a site
Figure 2: Running Set-SPOSite to set the Anyone link expiration period for a site

For example, this command sets a 10-day Anyone link expiration period for the https://Office365itpros.sharepoint.com/sites/Confidential site:


Need more information about managing SharePoint Online and OneDrive for Business? The Office 365 for IT Pros eBook is bursting out with ideas!

Advertisements

5 Replies to “How to Configure the Per-Site Anyone Link Expiration Policy for SharePoint Online Sites”

  1. Cloud we somehow block this feature? I do not like the idea that some site bypass the global policy? I was not able to find an option via “Set-SPOTenant”

  2. I have a question, Does this only apply to anyone Links ? And not for “New and Existing Guest” for example. So if we do not allow anyone Links there is no possibilty to let Shared Links to expire. Many Greetings Erik

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.