Hi,
I have written a simple application that queries a local or remote computer's services and then outputs the results to the screen and a simple text log file.
The app currently takes two arguments, the machine and the service name, it then passes the arguments into two variables and uses this to query the service status. I am using the System.ServiceProcess namespace and the System.Diagnostics namespace.
What I want to do now is to turn the little app into a scheduled job and to do this I want it to work through a list of machines, query their services, and then write this information to a log file.
I have decided XML is the best tool for this as it means I can simply export an Oracle table to an XML file and then get the C# app to read the XML file elements for the machine name, the services and the perform the service query action.
As I am still learning the ropes with C# I am not too familiar with the XML namespace and I am having trouble trying to construct a class that will do the following:
1. Open an external XML file (I am thinking of using the XMLDocument option for this)
2. Move to the first Element and read the hostname
3. FOR each SERVICE in MACHINE
3.1 Query Service Status and log result
I have tried the various Microsoft examples however I feel due to my current lack of experience with C# and XML I am struggling to find a suitable solution.
Many thanks in advance,
FZ
I have written a simple application that queries a local or remote computer's services and then outputs the results to the screen and a simple text log file.
The app currently takes two arguments, the machine and the service name, it then passes the arguments into two variables and uses this to query the service status. I am using the System.ServiceProcess namespace and the System.Diagnostics namespace.
What I want to do now is to turn the little app into a scheduled job and to do this I want it to work through a list of machines, query their services, and then write this information to a log file.
I have decided XML is the best tool for this as it means I can simply export an Oracle table to an XML file and then get the C# app to read the XML file elements for the machine name, the services and the perform the service query action.
As I am still learning the ropes with C# I am not too familiar with the XML namespace and I am having trouble trying to construct a class that will do the following:
1. Open an external XML file (I am thinking of using the XMLDocument option for this)
2. Move to the first Element and read the hostname
3. FOR each SERVICE in MACHINE
3.1 Query Service Status and log result
I have tried the various Microsoft examples however I feel due to my current lack of experience with C# and XML I am struggling to find a suitable solution.
Many thanks in advance,
FZ