SharePoint online Troubleshooting: external content sharing–Anonymous option grayed out
If you are staring at the screen what would have gone wrong with anonymous external sharing option which stays grayed out even after enabling the functionality from the Admin center, you are not alone as it seems to be a well-known issue. You can keep trying the Admin portal interface but this post is for those who didn’t got it sorted.
https://manojviduranga.files.wordpress.com/2018/07/image_thumb.png?w=686&h=468
The usual place to look at when you need to enable this option in SharePoint online is the Admin Centers —> SharePoint —> Sharing —> Sharing outside your organization
https://manojviduranga.files.wordpress.com/2018/07/image_thumb1.png?w=176&h=100
If the following options are enabled, you should be able to see the Anonymous option in the sharing prompt.
https://manojviduranga.files.wordpress.com/2018/07/anonymous-sharing_thumb.png?w=739&h=465
If you still do not see the option, you can go ahead and try this PowerShell code to enable this manually. This will immediately enable the functionality in your tenant.
Firstly, download and install SharePoint online management shell from here
Then find it from the start menu and run it with elevated permissions (Run as Administrator)
https://manojviduranga.files.wordpress.com/2018/07/sharepointshell_thumb.png?w=380&h=203
Run the following lines one by one (Customize the advised values to match your organization and URLs)
$adminUPN=”Admin Email address” (user the admin account you use to login to your office 365 Admin portal)
https://manojviduranga.files.wordpress.com/2018/07/image_thumb2.png?w=578&h=46$orgName=”YourOrgname” (use initial domain, initialdomain.onmicrosoft.com)
https://manojviduranga.files.wordpress.com/2018/07/image_thumb3.png?w=472&h=20
$userCredential = Get-Credential -UserName $adminUPN -Message “Type the password.” (Don’t change anything here, the “type the password” is for the prompt textbox only)
https://manojviduranga.files.wordpress.com/2018/07/ps1_thumb.png?w=853&h=37
You will be prompted for credentials verification. Provide the username/password and hit ok.
https://manojviduranga.files.wordpress.com/2018/07/credentails_thumb.png?w=314&h=223
Connect-SPOService -Url https://$orgname-admin.company.com -Credential $userCredential (no change here either)
https://manojviduranga.files.wordpress.com/2018/07/ps3_thumb.png?w=686&h=25
And here’s the final step. Do not run this for all site collections. Find out which are the ones requires external sharing and run it for those sites only.
Set-SPOSite -Identity https://myorg.sharepoint.com/sites/ExternalSiteName -SharingCapability ExternalUserAndGuestSharing
Change the link above with the site you want to enable the external sharing with.
https://manojviduranga.files.wordpress.com/2018/07/ps2_thumb.png?w=961&h=33
Once PowerShell command returns the success, refresh the browser and you will see the feature enabled.
https://manojviduranga.files.wordpress.com/2018/07/image_thumb4.png?w=310&h=414