In the screenshot above, you can see when a site owner or member tries to share a document, the “Anyone with the link” option is greyed out and if you can see from the tooltip the error says “Your organization is preventing you from selecting this option“. The first places to check as an administrator are your Sharepoint and OneDrive Admin Centers. If everything is set correctly and you still can’t select the Anyone With The Link option, then we have to turn to Powershell. If the Sharepoint Online site was created as a part of an Office 365 Group or Team, those sites come with more restrictive sharing options than a standard Sharepoint Online site and require you to use Powershell to make the change because there’s no GUI option for it.
Check Your Sharepoint and OneDrive Admin Centers
You’ll first want to check the sharing options in these admin centers before moving onto the next step.
- Go to admin.microsoft.com to get into your Office Admin Portal
- In the left navigation menu, go to Admin Centers
- In the OneDrive Admin Center, click on Sharing
Under Links, make sure the radio button is on Shareable: Anyone with the link as seen in the screenshot below
- In the Sharepoint Admin Center, click on Sharing
Under Sharing outside your organization, make sure the radio button is on Allow sharing to authenticated external users and using anonymous access links as seen in the screenshot below
Powershell Sharing Setting Using Sharepoint Online Management Shell
If the above settings are correct in your admin centers and the Sharepoint Online site was created using an Office 365 Group or Team, then you’ll need to use this Powershell command to enable external sharing.
- First, if you haven’t already done so, you’ll need the Sharepoint Online Management Shell. You can download and install it from Microsoft
- Next, open the Sharepoint Online Management Shell
- If you’re not already connected, you’ll need to run
Connect-SPOServiceand authenticate to your site
You’ll need to use the tenant admin URL like https://contoso-admin.sharepoint.com
- Finally, you’ll want to run
Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -SharingCapability ExternalUserAndGuestSharingto enable external and guest sharing
Replace the Identity URL with your site. Make sure there’s no trailing slash in your URL
If you don’t know your specific site URL, you can run
Get-SPOSite to get a list of all sites managed by the admin tenant you’re signed into.
If you refresh your Sharepoint/Onedrive site, you should now be able to share using Anyone with this link.