Authoring Management Packs – the fast and easy way, using Visual Studio???




I know what you are thinking.  “Wait, what did he just say?”




Well, hear me out.

Over the years, there have been many tools that we have used to write MP’s.  The SCOM UI Authoring tab, Notepad, XML Notepad, Notepad++, SCOM 2007R2 Authoring Console, Silect MP Author, and Visual Studio.


They all have tradeoffs.  I’d argue the most powerful tool over the years that was “somewhat” user friendly was the SCOM 2007R2 authoring console.  Once you learned the quirks, it was pretty good when you needed to make complex MP’s.  But even it was far from perfect.  And moving into SCOM 2012, now that the schema changed, using it becomes VERY challenging to update your existing MP’s.  Silect’s MPAuthor ( has stepped up in a big way to fill some of these gaps, and they have done a fantastic job of creating wizards that spit out MP’s that are useful, and relatively easy to author.  But they don’t have a wizard for all scenarios, and they don’t offer a way to update the workflows using the same UI that created them, so you are back to XML at that point.


Visual Studio has a powerful plugin called VSAE (Visual Studio Authoring Extensions)

The challenge with VSAE is unless you come from a developer background using Visual Studio, or you write management packs all day for a living, most people find it VERY daunting to use.  Even with experience, I find adding certain module types VERY cumbersome to use.  I find customers rarely use Visual Studio for authoring because of this.


I think that can change.  I have been presenting a different method on using VSAE with my customers and it has resonated very well.  The most powerful part of VSAE to me, is the ability to use Management Pack fragments.

A Management Pack fragment is simply a bit of XML, that contains all the “working parts” for a specific workflow….   Several authors have written about the power of fragments since VSAE launched, but the biggest gap I saw can be broken up into two major issues:

  • Nobody provided a good “library” of workable MP fragments
  • Nobody came up with a VERY simple method to reuse fragments quickly and easily


I hope to change that.  I am presenting an MP fragment library for you to download, and a simple methodology to add fragments to a MP you wish to create.  If you can do a FIND and REPLACE in notepad, you can use this.


What if I told you, in a few *minutes*, you could write a full Management Pack, that discovered an application dynamically, created views for the app, monitored for events and performance, monitored key services, and could even run your custom scripts against the app using VBScript or PowerShell?


I will be starting a blog series, which will include step by step examples of these fragments, and how to use them.


You can download the fragment library here on TechNet gallery:


This will be a step by step series.  You really should go in order if you are just getting started, but it isn't really required except for the first two parts.  You can complete ALL of these in less than an hour, even for a first timer.


Part 1: Use VSAE to create a new Management Pack Project

Part 2: Use VSAE fragments to dynamically discover an application based on the existence of a registry key or value

Part 3: Use VSAE fragments to monitor a service

Part 4: Use VSAE fragments to create an alert generating event log rule

Part 5: Use VSAE fragments to create a performance collection rule

Part 6: Use VSAE fragments to add Alert, State, and Performance views to your MP

Part 7: Use VSAE fragments to add custom Groups to your MP

Part 8: Use VSAE fragments to create a Windows Performance Monitor with Consecutive Samples


There MANY more fragments available in my download than just what I am documenting here.  These are just a basic walkthrough of VERY common workflows, to show how easy it can be, to use VSAE and create great management packs, quickly.  I will add additional examples as time goes on.  I welcome any feedback or MP fragment requests to be added to the library.


One of the important things to remember – is you aren't limited by the fragments I provide.  You can (and should) make your own fragments, specializing them to your company.  For instance, one of the FIRST things you should do, is download all the fragments, and replace ##CompanyID## with your actual company ID.  This way – that is one step already eliminated in your find/replace steps.  If you ALWAYS do specific things with your classes (such as you always create classes AND groups) then you should combine these fragments into one.  It will just make it that much faster.



Let the “easy series” begin.  Smile



Comments (26)

  1. Chris Gibson says:

    Amazing, This is exactly what I’ve been after. Complex discoveries is always something that has caused me trouble (Script discoveries – creating the right king of class and Discovering new classes based on properties of other classes – i.e. DB name). If you post code for those two, that would be awesome

    1. Kevin Holman says:

      Help me understand exactly what you are looking for. Not sure I follow you Chris.

      1. Chris Gibson says:

        Sorry the delay. If I discover a server, which has a property of “DBName” I would like to able to use the value of this property to find the DB and populate a group. So if in the future the DB gets changes, scom can just discover it. Does that make sense?

        1. Kevin Holman says:

          No – I am afraid I am not following you.

          What are you trying to accomplish at the end of the day?

  2. rob1974 says:

    Hi Kevin,

    Great initiative, allthough i wonder why you’ve chosen the “mp fragment” way and not create a “template” from within Visual studio itself that contains all the snippets in it. It would make the creation of mp’s even easier with the “snippet data” item.

    1. Kevin Holman says:

      Hi Rob,

      That’s certainly possible – and I wrote about those here: Anyone could take these base fragments, and create their own snippet templates from them using find and replace for the text strings pretty easily. I was trying to make this as simple as possible, while focusing on creating a large library of fragments first. If a customer decides they want to create a large amount of workflows, they can always convert one of them into a snippet. I expect customers to modify these fragments into their own standards and preferred designs as they progress. I see snippets as a “next step” when they have a lot of something to write. If I only have a few rules, or a few monitors, or a single class, I’d rather work with fragments, myself.

      1. rob1974 says:

        actually you can just use the same method with snippets (add existing item > select all files and add the .snippettemplate). Now instead of the replace action you need to add a new item “snippet data” and choose the template you’ve just added. I might even call it the faster and easier way 🙂

        1. rob1974 says:

          Is there an easy way to send you fragments/snippets? Here’s my 2property.serviceclass.discovery.templatesnippet:




          #text(‘serviceclassdisplayname’)# ($Target/Property[Type=”#alias(‘Microsoft.Windows.Library’)#!Microsoft.Windows.Computer”]/NetbiosComputerName$)



          Custom #text(‘serviceclassdisplayname’)# Class Discovery
          Class discovery for #text(‘serviceclassdisplayname’)#. Discovers the #text(‘servicename’)# service on windows computers

          Custom.Service.#text(‘serviceclassname’)# Class



          1. rob1974 says:

            well that’s not easy as it removes quite some things 🙂

    2. Hi!

      I did something like this actually. And released it last week. 🙂
      If you look at the site there is a number of guides there and an extension to Visual Studio that gives you a number of snippets to use. These are “Visual studio snippets”, so you right-click and inserts the code. Then you tab your way through a number of fields and enter your values.

      Me and some of my customers have been using this for almost a year and it’s really quick to use.
      So please check it out to see if it fits your needs. 🙂

      Not all guides are up yet, and there’s more snippets coming. But it’s a start.
      Oh, forgot to say that it’s free. 🙂

      1. rob1974 says:

        not the “snippets” i was looking for, but very cool you’ve installed it in visualstudio like this.

      2. Andres Naranjo says:

        Your snippets built into Visual Studio like this are pretty awesome. Great job!
        I wish you had Monitors too!

  3. sepeck says:

    The challenge with VSAE is Visual Studio. Visual Studio and it’s cryptic errors are such a huge barrier in and of itself. People who work with it often have adjusted to it, usually within a week or two. Also the flexibility and power of Visual Studio contribute to this. Property windows not being the ‘right’ property windows unless you have clicked the right thing, if you detach a window and ‘lose it’ recovering it is insanely hard if you have no clue. Before firing up VSAE, I suggest people take a basic Level 100 coding course on MS Virtual Academy and just focus on learning Visual Studio. I did a level 100 C# class. It helped a ton when I got to take the MP Authoring WorkshopPLUS course last month because I was able to focus on mostly the VSAE stuff and the few little things I missed in the VS interface previously. Just a suggestion for anyone new to VSAE.

  4. sepeck says:

    Alright. I figured I would report back. This snippet approach rocks.

    I had an app with 16 services they wanted monitored, so a pretty straight forward one. Having just attended the WorkshopPLUS course I was working my way through the example labs and such to create my MP. This came out and I decided to give it a try. Fast. It’s also helping me better understand how this whole thing works. I may be able to understand that template method now. Of course I have this backlog of requests to knock out first. A lot of ours has to do with Process monitors so I will have to look at what I did in the past and adapt.

    Thanks for the resource.

  5. Amazing. I’ve been using VSAE for about 2 years to create so many MPs and after some while I found that Templates are not useful enough. Then I started using MP fragments and they are great. However, there are some difficulties using VSAE such as finding errors, debugging, and analyzing the code. Moreover, there are some tools for analyzing, simulating or Cookdown checking which are not usable. Simulating specifically is a good approach if we could use it for finding our errors.
    Thanks again for your great job.

  6. User says:

    The “easy series” needs to exist for SCSM!

  7. Just awesome Kevin. Keep up de excellent work.

  8. John Austin says:

    FYI, there seems to be an issue with the “Monitor.TimedScript.PowerShell.SQLQuery.mpx” fragment. The ##ClassID## tag in the UnitMonitor section needs quotes around it, I believe.

    1. Kevin Holman says:

      You are correct – and I caught that recently – it will go into 1.7 which should be published today to include new goodies for you. Thanks for the feedback. Feel free to shoot me direct email as well!

  9. Jason Rydstrand says:

    You have an article on creating discoveries for monitoring dynamically named services, which is great. The question I have, is how to do this with VSAE instead of utilizing the Authoring console? (SCOM 2016)

  10. John Haggerty says:

    Hi Kevin,

    These are great! I am running into an instance were I need to use a timed 2 state PowerShell script monitor. I am using your “Monitor.TimedScript.PowerShell” MP fragment but I need it to do a couple extra things.

    First, I need to be able to define an overridable parameter that the script uses for the threshold.

    The other thing is, I’m saving a value in a property bag and would like to use it in the output or the alert description of the alert.

    I have tried making these changes myself without any luck. Your assistance would be greatly appreciated.

    1. I forgot to login before posting my last message.

  11. Iske says:

    Hi Kevin,

    Thanks for this amazing series of posts which really motivated me to use VSAE.
    I downloaded your samples and used “Class.And.Discovery.SNMP.Device.byOID.mpx” and was able to discover ou Cisco Switches. Now I’d like to add an additional property “serial number” to the Cisco class which gets populated by a snmp probe .
    Any idea what I need to add in your sample ?

  12. Leif Rønnow says:

    I’ve a question regarding what Class I need to use in this scenario: I need to monitor an endpoint at a Vendor we are coorperating with. The endpoint gives me how many items that are in a Queue(Powershell script). I want to create an alert if the Queue value is grather than %something% and a Healthstate based on the Queue value. I dont want to base it on a Computer class(Watcher node).

  13. Graham-LP says:

    Hi Kevin,

    Great Webinar held by Silect last week, and your presentation of MP fragments in MP Author was excellent, thanks again. Question re: importing the Monitor.Process.mpx to monitoring processes for an application MyApp which has multiple processes, however MyApp processA runs on serverA and MyApp processB runs on ServerB – same MyApp application. When using Discovery would it be feasible to have multiple processes monitors run on different servers in the same MP and the best way to achieve this with Discovery to ensure that the appropriate monitor for processA monitors only on MyApp serverA and monitor for processB only monitors MyApp serverB or would this require the 2 x process monitors to be split into separate MPs?

    1. Graham-LP says:

      Hi Kevin,

      Probably forget my last comment re: application MyApp which has multiple processes; I think my answer is to create an initial discovery, then perhaps separate WMIQuery discoveries looking for each process to be monitored targeting the initial Discovery, then create monitors targeted at each of the WMIQuery discoveries for each of the processes?

      However, (consider the same application is run on servers in a PAT environment, and on servers in a PROD environment) would it be possible to create a fragment that discovers an application by REG Key can also in the same discovery a search for particular domain, so that when creating an application MP (app.pat) servers that are in PAT ( environment populate the PAT groups created with Class.Group.ClassInstances.mpx Class.Group.WindowsComputers.mpx Class.Group.WindowsComputersAndHealthServiceWatchers.mpx, and then a second created application MP ( for servers that are in the PROD ( environment populate the PROD groups created with Class.Group.ClassInstances.mpx Class.Group.WindowsComputers.mpx Class.Group.WindowsComputersAndHealthServiceWatchers.mpx. This is to create and keep separate groups and State, Alert, and Perf views of PAT servers and PROD servers, instead of seeing all PAT and PROD servers in the same views that would occur with just a discovery of just the application REG key?

Skip to main content