SharePoint 2007 | List All Web Applications in Farm

So you think it would be cool to have a dropdownlist with all web applications from your SharePoint Farm Server?

using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

(...)

SPFarm spf = SPFarm.Local;
SPWebService spws = spf.Services.GetValue("");

foreach (SPWebApplication spwa in spws.WebApplications)
{
ddl_MyWebs.Items.Add(spwa.DisplayName);
}

My thanks go to Brian for this great code

Comments

Popular posts from this blog

Mobile development opportunities

Breaking down document locking in SharePoint

Working around X-Frame-Options for iframes