Hi,
Can someone help? I need to write an application that will check whether a set of services are running on a server. The application will check every 5 minutes.
I am aware of the ServiceController object that can check the status of a service, but what I want to do is check the all the services running under a specific 'Log On As', rather than hard-code the name of the service.
Does anyone know if there is an object that exposes the services as a collection so that I can write a foreach statement to check the services?
Thanks
Paul
Loading

Lalit MRank #1,186 · 1.5K reputationPosted Feb 15, 2010, 12:56 AM EST
// Check the status of this service to see if // it can be stopped bool bCanStop = controllers[i].CanStop; item.SetSubItem(3, bCanStop ? "Yes" : "No"); // Check if the service recieves notification when // system shuts down. bool bCanShutDown = controllers[i].CanShutdown; item.SetSubItem(4, bCanShutDown ? "Yes" : "No"); // Check if the service can be paused and continued. bool bPauseNContinue = controllers[i].CanPauseAndContinue; item.SetSubItem(5, bPauseNContinue ? "Yes" : "No");show here details
Lalit MRank #1,186 · 1.5K reputationPosted Feb 15, 2010, 1:00 AM EST
http://www.geekpedia.com/tutorial225_Listing-Services-with-Csharp.html
http://www.devasp.net/net/articles/display/722.html
paul walker29 reputationPosted Feb 15, 2010, 1:29 AM EST
Any ides how I can get hold of this?
Thanks again
Paul