The problem with writing these using the console - is the it does make them
difficult to find in the SQL tables (among other problems).
Once a SCOM admins starts to mature, and understands XML - they really should
write these custom classes using the SCOM 2007 R2 authoring console - or Visual
Studio.
The reason is - when you do this activity in the SCOM UI, to keep things simple
for the beginner - we assign GUID type data for the class ID's, and qworkflow
ID's, to keep them unique, however this makes for ugly XML that is replicated
in the SQL database.
For instance - if my extended class XML definition looks like this:
<ClassTypes>
<ClassType ID="Typebc06f4a55a1e45269e09d55fed8bbd1d"
Accessibility="Public" Abstract="false"
Base="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer" Hosted="false"
Singleton="false" Extension="false">
<Property
ID="AttributeDiscoveryGeneratedByUI361089606a424432a0e9553dfa7da61c"
Type="string" AutoIncrement="false" Key="false" CaseSensitive="false"
MaxLength="256" MinLength="0" Required="false" Scale="0" />
</ClassType>
</ClassTypes>
That is my class ID highlighted.
So in SQL - I could query for the ManagedType table, to find my managedtypeID
select * from ManagedType
where TypeName = 'Typebc06f4a55a1e45269e09d55fed8bbd1d'
I could also just query the dynamically generated ManagedType Table:
select * from MT_Typebc06f4a55a1e45269e09d55fed8bbd1d
Alternatively - since I am using Windows Computer as my base class - I can also
directly query the Windows Computer managed type view:
select * from MTV_Computer
The issue becomes - the attribute name is UGLY - another guid (see above in XML
for the property ID)
So it can be done... it is just a little ugly unless you clean up the XML. If
someone created this with the UI - wheat I do is go in and FIND/REPLACE each
class ID and property ID with a better ID that is simpler to search for:
Typebc06f4a55a1e45269e09d55fed8bbd1d becomes "My.Custom.Computer.Class" or
whatever follows the ID of the MP.
AttributeDiscoveryGeneratedByUI361089606a424432a0e9553dfa7da61c becomes
"SupportLevel" (or whatever you want for your propertyname)
From: [email protected] [mailto:[email protected]] On
Behalf Of Pete Hakesley
Sent: Monday, May 23, 2016 6:08 AM
To: MSMOM ([email protected]) <[email protected]>
Subject: [msmom] SCOM 2012 R2 UR9 SQL Question
Hi all,
I am using the Windows Computer_Extended class to checked registry key values
like in Kelvin Holman's excellent post about dynamic groups.
However I not want to create a custom SQL report for these attributes.
Can anyone tell where in the OpsDb the table/view I can use to access these
attributes?
Peter Hakesley | Monitoring & Automation Technical Lead Engineer, Data Centre
Services
t: +44(0)845 155 6556 ext: 4006
e: [email protected]<mailto:[email protected]> | w:
www.scc.com<https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.scc.com%2f&data=01%7c01%7ckevin.holman%40microsoft.com%7ca95d135b6c754a4336e508d382fb47e5%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=uvci6D3innhb5DKbN6DegwEBHbVEoalBZj52JgX6s8c%3d>
a: SCC, CV1, Cole Valley, 20 Westwood Avenue, Tyseley, Birmingham B11 3RZ