The first management pack authoring video is now available in the System Center How Do I? Videos collection. This walks through each step in the process to create a rule and monitor from a PowerShell script. Detailed topics included in the video include the following:
- How to change a PowerShell script to be included in a management pack.
- How to create a custom probe action module running a PowerShell script.
- How to create a custom data source module containing a probe action module.
- How to create a rule based on a custom data source module.
- How to create a monitor type based on a custom data source module and probe action module.
- How to create a monitor type supporting both regular detection and on demand detection.
- How to create a monitor based on a custom monitor type.
These are all very common scenarios, and I see people struggle with some of the details – especially those trying to tackle it for the first time. Hopefully this video will serve as a good resource for clearing up some of the questions.
What about VBScript?
While the video doesn’t discuss VBScript, only the first two bullets in that list would change if you were using a VBScript script instead of PowerShell. Changing the script itself is almost identical – just a matter of the different syntax between languages and using the Return method in VBScript at the end of the script to return the property bag.
When creating the probe action module, you use Microsoft.Windows.ScriptPropertyBagProbe instead of Microsoft.Windows.PowerShellPropertyBagProbe. The arguments are the same but provided on the single Arguments parameter instead of the Parameters node. We have examples of script arguments in several places.
Any more videos coming?
The simple answer is Yes. We’ll go the other end of the spectrum on the next one which is going to cover the basic concept of selecting a target and creating a simple class. That one should be out within the next few weeks. Beyond that, while we don’t have specific topics yet, we will be working on regular submissions. There are definitely more on the way, and I will announce them here and on the Twitter feed.