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).
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).
For example, this command sets a 10-day Anyone link expiration period for the https://Office365itpros.sharepoint.com/sites/Confidential site:
# Set Anyone link expiration period for the site
Set-SPOSite -Identity https://Office365itpros.sharepoint.com/sites/Confidential -AnonymousLinkExpirationInDays 10 -OverrideTenantAnonymousLinkExpirationPolicy $True
Need more information about managing SharePoint Online and OneDrive for Business? The Office 365 for IT Pros eBook is bursting out with ideas!