SPWebApplicationBuilder webAppBuilder = new SPWebApplicationBuilder(SPFarm.Local);
webAppBuilder.Port = portNo;webAppBuilder.ApplicationPoolId = "IIS application ID";
webAppBuilder.IdentityType = IdentityType.SpecificUser;
webAppBuilder.ManagedAccount = mngAcc;
webAppBuilder.RootDirectory = new DirectoryInfo("physical path of web application"));
webAppBuilder.ManagedAccount = mngAcc;
webAppBuilder.RootDirectory = new DirectoryInfo("physical path of web application"));
webAppBuilder.ServerComment = "Server comment";
webAppBuilder.UseNTLMExclusively = true;
webAppBuilder.AllowAnonymousAccess = false;
webAppBuilder.CreateNewDatabase = true;
webAppBuilder.DatabaseServer = "SQL Server name";
webAppBuilder.AllowAnonymousAccess = false;
webAppBuilder.CreateNewDatabase = true;
webAppBuilder.DatabaseServer = "SQL Server name";
webAppBuilder.DatabaseName = "Database name";
if ("SQL Authentication is selected")
{
webAppBuilder.DatabaseUsername = "username";
webAppBuilder.DatabasePassword = "password";
}
{
webAppBuilder.DatabaseUsername = "username";
webAppBuilder.DatabasePassword = "password";
}
newApplication = webAppBuilder.Create();
SPFormsAuthenticationProvider fbaAuthProvider = new
SPFormsAuthenticationProvider(membershipProvider, roleManager);newApplication.UseClaimsAuthentication = true;
newApplication.IisSettings[SPUrlZone.Default].AddClaimsAuthenticationProvider(fbaAuthProvider);
newApplication.Update();
newApplication.Provision();
No comments:
Post a Comment