In Central Administration\Manage Web Applications, there is the ability to enable anonymous access on a web application through the authentication providers. Is there a way to programmatically determine if this option is enabled? Thanks!
Asked
Active
Viewed 1,323 times
2 Answers
3
This should work for you:
web.Site.WebApplication.IisSettings[Microsoft.SharePoint.Administration.SPUrlZone.Internet].AllowAnonymous
I started with web, but you can start wherever you need obviously. Also make sure you look at the appropriate zone.

Jaime Torres
- 10,365
- 1
- 48
- 56
1
The SPWeb object expose the following boolean :
AllowAnonymousAccess
example :
web.AllowAnonymousAccess;
MSDN : Gets a Boolean value that indicates whether anonymous access is allowed for the website

Le_Fredo
- 639
- 3
- 5