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
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
Post a Comment