How To: Determine the Root Enumeration GUID of an Enumeration Data Type Property

Every property on a class in SCSM has a data type - string, date/time, integer, etc.  One of the data types is 'Enumeration' or 'Enum' for short.  An enumeration data type property is a property which has a constrained set of possible values.

For example, a mobile phone class might have an enumeration data type property called 'Manufacturer'.  The property values could be constrained to a list of options such as 'Apple', 'Nokia', 'Microsoft', 'Samsung'.  These property values can be organized into a hierarchy.  For example:

  • iOS
    • Apple
  • Windows Phone
    • Microsoft
    • HTC
    • Nokia
  • Android
    • HTC
    • Samsung

     

Each enumeration value has a GUID ID in SCSM.  The GUID ID is generated as a function of the ID of the Enumeration in the management pack XML and the identity of the management pack.  Thus the GUID is not known until the management pack is imported into SCSM.  The GUID will be the same in all SCSM management groups that the management pack is imported into because the MP identity and enumeration ID remain the same.  Here is an example of what the management pack XML looks like for an enumeration data type property and it's associated enumerations:

<enumerationtypes>
<enumerationvalue ID="PhoneManufacturer" Accessibility="Public">
<enumerationvalue accessibility="Public" id="Enum.51597790833b4909b15dfaae625e438b" ordinal="0" parent="PhoneManufacturer">   <--- iOS
<enumerationvalue accessibility="Public" id="Enum.3d20aad51fea489aa52ebc2293329dc6" ordinal="1" parent="PhoneManufacturer">    <--- Windows Phone
<enumerationvalue accessibility="Public" id="Enum.f7e6cd251aa0456a9dba4ca1e857ebea" ordinal="2" parent="PhoneManufacturer">    <--- Android
<enumerationvalue accessibility="Public" id="Enum.9fd8816b10a242e48becfb3474dcdc6a" ordinal="0" parent="Enum.51597790833b4909b15dfaae625e438b">    <--- Apple
<enumerationvalue accessibility="Public" id="Enum.237e403086b94821abbf312010e242b3" ordinal="0" parent="Enum.3d20aad51fea489aa52ebc2293329dc6">    <--- Microsoft
<enumerationvalue accessibility="Public" id="Enum.985f8fae8d5443fc929db17534e9247e" ordinal="1" parent="Enum.3d20aad51fea489aa52ebc2293329dc6">    <--- HTC (Windows PHone)
<enumerationvalue accessibility="Public" id="Enum.7381cc0eaf73469eaf9c8d76067d9d43" ordinal="2" parent="Enum.3d20aad51fea489aa52ebc2293329dc6">    <--- Nokia
<enumerationvalue accessibility="Public" id="Enum.c9a40650fba742ec85c9d74b99850f2b" ordinal="0" parent="Enum.f7e6cd251aa0456a9dba4ca1e857ebea">    <--- HTC (Android)
<enumerationvalue accessibility="Public" id="Enum.66888c1d57474a3eb207ea0489b6c27b" ordinal="1" parent="Enum.f7e6cd251aa0456a9dba4ca1e857ebea">    <--- Samsung
</enumerationtypes>

Notice how the enumeration element has a EnumType attribute that is set to 'PhoneManufacturer' which is the ID of the "root" Enumeration.  All other enumerations are a child of that enumeration.  The "root" enumeration is never shown anywhere in the UI.  Only the children of the root enumeration and their descendents are shown in the UI. 

To determine the "root" enumeration GUIID (or any other enumeration) you can do one of two things:

  • Use SMLets and execute a command like this:  
    Get-SCSMEnumeration   Example: Get-SCSMEnumeration PhoneManufacturer | Format-Table ID, Name
  • Query the ServiceManager database like this:
    SELECT EnumTypeId, EnumTypeName FROM EnumType WHERE EnumTypeName = 'PhoneManufacturer'

If you don't know the ID of the root enumeration you can use the display name of one of it's immediate children (i.e. top level in the enumeration hierarchy if there is one) to figure it out.  Example using 'iOS' as the display name:

(Get-SCSMEnumeration | ?{$_.DisplayName -eq 'iOS'}).Parent.Identifier.Path