Best Practice: Target expressions should be valid

 

What does this best practice check for?

In order for a management pack to be valid, it is important that all references in the XML are valid references. As a best practice, target expressions in workflows and modules ($Target$ expressions) should reference types that are defined either in the MP, or in an MP that is referenced.

Why is it important to follow this best practice? What is the impact of not following this best practice?

Not following this practice will break functionality of the workflow in question. This will also cause events to be logged in the Operations Manager event log that signal that a workflow has failed.

How do I fix this?

Using the Authoring Console:

1.        When defining workflows using the Authoring Console, you will only have the option to use $Target$ references that are defined in a referenced management pack.

Using XML:

     < Discovery ID = " Microsoft.Windows.KeyManagement.Service.Discovery" Enabled =" true" Target =" Windows!Microsoft.Windows.Computer" ConfirmDelivery =" false" Remotable =" true" Priority =" Normal" >

       < Category > Discovery </ Category >

       < DiscoveryTypes >

          < DiscoveryClass TypeID = " Microsoft.Windows.KeyManagement.Service" >

           < Property PropertyID = " ProcessID" />

           < Property PropertyID = " ImageName" />

           < Property PropertyID = " FilePath" />

           < Property PropertyID = " ServiceName" />

           < Property PropertyID = " ServiceState" />

           < Property PropertyID = " KMSServicePath" />

           < Property TypeID = " System!System.Entity" PropertyID =" DisplayName" />

         </ DiscoveryClass >

         < DiscoveryRelationship TypeID = " Windows!Microsoft.Windows.ComputerHostsComputerRole" />

       </ DiscoveryTypes >

       < DataSource ID = " DS" TypeID =" Microsoft.Windows.KeyManagement.Service.Discovery.DataSource" >

         < IntervalSeconds > 86400 </ IntervalSeconds >

         < SyncTime />

          < ComputerID > $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$ </ ComputerID >

          < ComputerName > $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$ </ ComputerName >

         < TimeoutSeconds > 300 </ TimeoutSeconds >

       </ DataSource >

     </ Discovery >

Referenced MP:

       < ClassType ID = " Microsoft.Windows.Computer" Base =" System!System.Computer" Accessibility =" Public" Hosted =" false" Abstract =" false" >

          < Property ID = " PrincipalName" Type =" string" Key =" true" CaseSensitive =" false" />

         < Property ID = " DNSName" Type =" string" />

         < Property ID = " NetbiosComputerName" Type =" string" />

         < Property ID = " NetbiosDomainName" Type =" string" />

         < Property ID = " IPAddress" Type =" string" />

          < Property ID = " NetworkName" Type =" string" />

         < Property ID = " ActiveDirectoryObjectSid" Type =" string" />

         < Property ID = " IsVirtualMachine" Type =" bool" />

         < Property ID = " DomainDnsName" Type =" string" />

         < Property ID = " OrganizationalUnit" Type =" string" />

         < Property ID = " ForestDnsName" Type =" string" />

         < Property ID = " ActiveDirectorySite" Type =" string" />

         < Property ID = " LogicalProcessors" Type =" int" />

       </ ClassType >