Create a new SPWebApplication in multiple front-ends environment

When you call the Provision() method it's provisions the application on the local server ONLY. This is fine for a single web front end, but what about multiple front-ends environment? Well, good news, there a new ProvisionGlobal() method which can provision Webapplication to multiple front-ends. However, you'll need to have the Microsoft.sharepoint.dll version 12.0.6318.5000 installed to call this method.

To get this dll you will need to install the "Infrastructure Update for Windows SharePoint Services (KB951695)"

Download 32-bit / 64-bit

Make sure you read this before installing this update:

In this example you provision a new SPWebApplication object on multiple front-ends.

static void Main(string[] args)
SPWebApplicationBuilder appBuilder = new SPWebApplicationBuilder(SPFarm.Local);
int port = 80;
appBuilder.Port = port;
SPWebApplication webApplication = appBuilder.Create();

//provision the web application on the local server

//provision the web application on all front-ends

SPSite siteCollection = webApplication.Sites.Add("/", "domain\\ahavivi", "");

Next Post »
0 Komentar