Situation: We want to monitor a service’s startup type and make sure that it is not set to automatic – disabled or manual is ok. If the service is set to automatic we want to set it to manual
Step 1: Create a new management pack.
Because we do not have a management pack related to this program yet I need to create another one. I will use the Authoring console.
Step 2: Create a class for this program.
I am creating a class so that I can create a dynamic list of the servers that have this program installed and find out some information about this program. The workflows that I create then will be targeted at this class.
Connect to a computer that has the program installed
Step 3: Create the discovery
Discovery Targets are the computers that will have the discovery run on them. For example, if you choose windows server operating system the discovery will run on all windows servers (and then return us a subset that do indeed have the program we want to monitor installed on them)
Step 4: Create a new monitor Type
I am going to use a PowerShell script to detect if the startup of the service is set to automatic or not so I need to create a new monitor type. This monitor type will include a datasource System.Scheduler, a probe Microsoft.Windows.PowerShellPropertyBagProbe , and two expression filters (one for each state).
Step 5: Create the monitor
Now that we have the class and discovery created we can target workflow at the new class. Since the monitor I am going to create is a configuration type monitor (is a service configured to have startup type of Not Automatic) I will put it under the Configuration State rollup.