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

<!--[if lt IE 9]>


Comments (16)

  1. Hi Kevin. Looking at the first installment mpx in the library, I noticed on lines 51 and 55 some comments:

    “…since the default is boolean, we use “string”…”

    Should not we use type boolean if we are checking a boolean registry attribute definition? If it’s of type string, and the registry attribute definition is a boolean, I’m thinking it would always evaluate to true.

    1. Kevin Holman says:

      @ Jonathan –

      As long as AttributeType = 0, then you can use string or Boolean. They will be evaluated the exact same way. If you look at the code spit out by the SCOM 2007 R2 authoring console, it uses a String XpathQuery and Value Type. MPAuthor uses Boolean. When AttributeType=0, the expression “XPathQuery Type=”String”>Values/##AppName##RegKeyExists</XPathQuery" will resolve to True or False only.

      1. Ok. I remember dealing with this years back, and had some problems when types between the attribute definition and the expression filter did not match (particularly when dealing with boolean and string), but maybe this does work as expected in this case. Do you think it’s a good practice to use the same type in the expression filter as what is specified in the attribute definition?

        1. Kevin Holman says:

          As a general rule – absolutely.

          I was also trying to keep as few variables as possible in this ever-growing fragment library, so customers could change the fewest things and still have a working MP. However, the more I work with and try to understand all our native modules and their inputs and outputs, the more I like just using a PowerShell module to do whatever I want.

  2. sepeck says:


    In the Generic.Class.And.Discovery.Registry.ValueExpression.Fragment on line 29….
    Not sure you want everything before ##RegistryValue##

    1. Kevin Holman says:

      I actually did that on purpose – because that is only a SINGLE location in the XML for the registry value – and this seems like it would help customers to provide an example full path to the registry. The find and replace token for this one is really more of a guide to know you need to do “something” there. If a customers wanted to remove all that with their own customized version of the fragment – they should.

  3. GS says:

    Hi Kevin,
    Excellent set of articles …. great work! Do you have a discovery fragment example to perform a WMI discovery?

  4. Birdal says:

    Hi Kevin,
    I am very new in SCOM, and am in a very “cold water” in a complex IT infrastructure so that I must understand first SCOM 2012 and SCOM Authoring. I found your authoring article and wanted to “exercise” with it.
    Unfortunately your ZP packet does not incluse “Generic.Class.And.Discovery.Registry.KeyExists.Fragment.mpx”. Forgotten? Or am I blind? 🙂
    Best Regards

  5. Kevin Holman says:

    I renamed them to make the names shorter in the latest download.

    Just take off “generic”

  6. Hi Kevin,

    Unfortunately your ZP packet does not incluse “Generic.Class.And.Discovery.Registry.KeyExists.Fragment.mpx”. ? where i get this file?

    In the above line you reply to Mr.Harvansh Singh
    I renamed them to make the names shorter in the latest download.

    Just take off “generic”

    How can i get?

    Arjun walmiki

  7. i am download from the below link

    but not find the file =” Generic.Class.And.Discovery.Registry.KeyExists.Fragment.mpx”

    kindly send me the link if you have some other reference.

    Arjun Walmiki

  8. yes i have

    old name :- Generic.Class.And.Discovery.Registry.KeyExists.Fragment.mpx.

    new name :- Class.And.Discovery.Registry.KeyExists.

    Arjun Walmiki

  9. Daniel Haddad says:

    Hi Found this like and the parts are excellent learning for a newbie like me. The question i had is , is it possible to add several classes to one project. I.E. if i want to make a MP for RDS infrastructure that includes the RDSBroker, RDSGateway and RDS License server. I have created a new project and added a clase with registry key for rdsbroker that is looking at /System/CurrentControlSet/Services/Tssdis. If i wanted to target multiple registry keys such as the TSGateway and TermServLicensing keys how would i acomplish this. Would i import the Class.AndDiscovery.Registry.KeyExists.MPX a second time and modify it with the relevant info?

    1. Kevin Holman says:


      Or, you could use the registry discovery for a “seed” class which is not used for monitoring, but for lightweight registry discoveries only. Then you could target that class for additional discoveries of specific roles, and use registry wmi, or script based discoveries for each class. The base class for those can be local application still, or use can use more complicated abstract base classes for “RDS Server” or something like that. And you can build relationships between the classes if needed, such as “RDS Server hosts RDS Broker”, but again – this would only be for health rollups between classes, and special grouping….. it is not required. It just makes a sexier, more useful looking MP. If you want to get that advanced – look at some of the microsoft MP’s for ideas. However, I’d say those are for more experienced MP authors.

  10. Adam Hulek says:

    Kevin as always the most helpful guy 🙂 !!!
    SCOMming is much easier with your Fragments Library and all your posts and contribution in Microsoft Support.
    Thank You Kevin!

Skip to main content