[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-04-22
3
Medium Priority
?
1,240 Views
Last Modified: 2012-05-06
Hi,

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.

Regards,
Mushi
0
Comment
Question by:Mushq
3 Comments
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 750 total points
ID: 24211963
0
 
LVL 9

Assisted Solution

by:Sreedhar Vengala
Sreedhar Vengala earned 750 total points
ID: 24211969
Something on these lines:
  ApplicationPoolCollection applicationPoolCollection = serverManager.ApplicationPools;
   foreach (ApplicationPool applicationPool in applicationPoolCollection)    
   if (applicationPool.State == ObjectState.Stopped)        
    {            
		applicationPool.Start();        
	}

Open in new window

0
 
LVL 6

Author Comment

by:Mushq
ID: 24221800
Hi sree_ven,
The above mentioned code works in only IIS 7.0, is there any similar thing available for IIS 6.0.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses

873 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