Following steps allows you to enable
“Anyone” option for Guest Contributor
1) Run PowerShell as Administrator
Should be installed with latest version SharePoint Online Management
Shell
2) To Connect Online SharePoint the
power shell
$adminUPN="<the full email
address of a SharePoint administrator account, example: jdoe@contosotoycompany.onmicrosoft.com>"
$orgName="<name of your
Office 365 organization, example: contosotoycompany>"
$userCredential = Get-Credential
-UserName $adminUPN -Message "Type the password."
3) C:\Windows\system32>
Connect-SPOService -Url https://$orgName-admin.sharepoint.com
-Credential $userCredential (Sharepoint
Admin URL)
4) C:\Windows\system32>
(Get-SPOSite -Identity https://Contoso.sharepoint.com/sites/TeamSite).SharingCapability
Result: ExternalUserSharingOnly
5) PS C:\Windows\system32>
Set-SPOSite -Identity https://Contoso.sharepoint.com/sites/TeamSite
-SharingCapability ExternalUserAndGuestSharing
6) PS C:\Windows\system32>
(Get-SPOSite -Identity
https://Contoso.sharepoint.com/sites/TeamSite).SharingCapability
https://Contoso.sharepoint.com/sites/TeamSite).SharingCapability
Result: ExternalUserAndGuestSharing
Now refresh the SharePoint Page and check for the Share link