Enabling Anonymous Share Links in SharePoint Server 2019

SharePoint Server 2019 does not support anonymous sharing links (aka guest links). However, it only takes four lines of PowerShell to implement. In addition, you get link expiration. This configuration does require Office Online Server as the guest sharing links leverage the web-based Office viewer/editor. Keep in mind, this isn’t a supported configuration by Microsoft.

To enable this feature, run the following PowerShell from the SharePoint Management Shell:

$farm = Get-SPFarm

When we visit a modern Document Library, we can now select the ‘Anyone’ option with link expiration:


This yields a URL similar to the following:


We can then see that a link is available with a set expiration:


However you get the link to the end user (copy link or email), here is what the recipient sees (after enabling editing):


Finally, when the link expires should you choose that option, this is what the recipient sees:


And again, this is unsupported by Microsoft. After experimenting, you can disable this functionality by running the below cmdlets.

$farm = Get-SPFarm

Trevor Seward is a Microsoft Office Apps and Services MVP who specializes in SharePoint Server administration, hybrid scenarios, and SharePoint Online. He has been working with SharePoint for 16 years from SharePoint 2003 on up, managing environments with terabytes of content for 150,000+ user organizations. Trevor is an author of Deploying SharePoint 2016 and Deploying SharePoint 2019. You can find him on Twitter and in /r/sharepoint.