0

I need to monitor and control a set of Windows Services that are running either on a local machine or remotely. I've heard of WMI and ADSI and the first one seems to do what I want. Before going deep into it, I just want to check if I'm going in the right direction?

Thank you

EDIT Additional information: I also need to inspect SQL jobs and IIS instances so I think WMI is what I need.

Amokrane Chentir
  • 29,907
  • 37
  • 114
  • 158

2 Answers2

1

You might want to look at the ServiceController class.

http://msdn.microsoft.com/en-us/library/system.serviceprocess.servicecontroller.aspx

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
0

This might help for WMI monitoring SQL job events:

http://shellyourexperience.wordpress.com/2011/08/31/monitoring-sql-server-service-with-wmi-events-and-showui/

You could also check Win32_NTLogEvent class:

wmic /namespace:\\root\cimv2 path win32_ntlogevent where SourceName='%SQL%' get /all /format:csv >"%userprofile%\desktop\wmic_win32_ntlogevent.csv"

However I don't think this will list specific SQL jobs. That type of action should be done in SQL itself. ADSI is Active Directory Services Interface, I don't think this what you'll need this however that will depend.

MacG
  • 271
  • 2
  • 4