Wednesday, September 17, 2008

Getting all the Application Pool information

Code:


using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration
using System.ComponentModel;
using System.Collections.Generic;

SPWebServiceCollection wsc = new SPWebServiceCollection(SPFarm.Local);

foreach (SPWebService ws in wsc)
{
SPApplicationPoolCollection apc = ws.ApplicationPools;
foreach (SPApplicationPool ap in apc)
{
Response.Write(ap.Name);
Response.Write("</br>");
}
}

0 comments: