Tuesday, January 27, 2009

Checking weather sharepoint site is FBA enabled

Scenario:
I wanted to check if one of my site collection is FBA enabled.

Solution:
I did a simple check for the Authentication Mode as following.

Code:


using Microsoft.SharePoint.Administration;
using System.Web.Configuration;

public static bool IsWebAppFBAEnabled(SPSite site)
{
SPIisSettings settings = site.WebApplication.IisSettings[site.Zone];
return (settings.AuthenticationMode == AuthenticationMode.Forms);
}

0 comments: