C#: Programmatically need to know status of IIS Application pool

Posted on 2009-04-22
Last Modified: 2012-05-06

In C# how to find the state of the IIS application pool i.e. whether it is stopped or running.

Can anyone please provide some sort of tutorial or code for above mentioned things.

Question by:Mushq
    LVL 26

    Accepted Solution

    LVL 9

    Assisted Solution

    by:Sreedhar Vengala
    Something on these lines:
      ApplicationPoolCollection applicationPoolCollection = serverManager.ApplicationPools;
       foreach (ApplicationPool applicationPool in applicationPoolCollection)    
       if (applicationPool.State == ObjectState.Stopped)        

    Open in new window

    LVL 6

    Author Comment

    Hi sree_ven,
    The above mentioned code works in only IIS 7.0, is there any similar thing available for IIS 6.0.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now