Enumerating Application Pools in IIS

前端 未结 2 1420
我寻月下人不归
我寻月下人不归 2021-01-18 10:50

I am wondering if there is a way to enumerate the collection of applications pools (not the applications in a given pool - but the pools themselves) on the local IIS server

2条回答
  •  渐次进展
    2021-01-18 11:13

    Another way that might be helpful.

    using System.IO;
    using Microsoft.Web.Administration;
    
    namespace AppPoolEnum
    {
        class Program
        {
            static void Main(string[] args)
            {   
                    foreach (var appPool in  new ServerManager().ApplicationPools)
                    {
                        Console.WriteLine(appPool.Name);
                    }
            }
        }
    }
    

提交回复
热议问题