Allowing anonymous access to SharePoint content is configured in two parts, at the web application level and at the content level. In this recipe, we will enable anonymous access to our SharePoint web application.
Follow these steps to configure anonymous access at the web application level:
Authentication for SharePoint is handled at the web application level. A SharePoint web application represents a site in Internet Information Services (IIS). Authentication configuration for the SharePoint web application configures the IIS site accordingly to allow anonymous, unauthenticated users to access the web application.
Configuring anonymous access at the SharePoint web application level can also be accomplished with PowerShell or code using the server-side object model.
Follow these steps to configure anonymous access for a web application using PowerShell:
Get-SPWebApplication
Cmdlet:$webApp = Get-SPWebApplication http://sharepoint
AllowAnonymous
property for the IIS settings of the Default
zone to true
:$webApp.IisSettings[[Microsoft.SharePoint.Administration.SPUrlZone]::Default].AllowAnonymous = $true
$webApp.Update()
Follow these steps to configure anonymous access for a web application with code using the server-side object model:
var webApp = SPWebApplication.Lookup(new Uri("http://sharepoint"));
AllowAnonymous
property for the IIS settings of the Default
zone to true
:webApp.IisSettings[SPUrlZone.Default].AllowAnonymous = true;
webApp.Update();
18.188.211.106