Thursday, 7 March 2019

SharePoint 2016 root site "/" "Sorry this site hasn't been shared with you" 

Scenario:
User get access denied or Sorry this site hasn't been shared with you when they try to browse SharePoint site e.g. https://Sarav.com without /pages/default.aspx.

Complete URL e.g. https://Sarav.com/pages/default.aspx works and the problem only happens when users hit a particular WFE. The problem is because of some of your IIS configurations for that particular web app gets corrupted.

Solution:

Run Powershell as admin on the WFE where the problem is type the following

$webApp = Get-SPWebApplication https://YourSharePointSiteURL.com/

$webApp.Provision()

This re-provisions the IIS site and fixes the issues, also works if you have accidentally deleted the IIS web site.

Hope it helps!