Microsoft.Windows.WMIProviderWithClassAndRelationshipSnapshotDataMapper
Updated: May 18, 2012
Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager
The Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper module is a data source module type that queries Windows Management Instrumentation (WMI) for object data at a scheduled, recurring interval and returns the discovered class and relationship type instances as System.Discovery.Data type data.
Usage
Use this module only when you are creating a discovery workflow and want to discover relationship type instances. If you are only discovering a class, then you should use Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper. For more information about class types, see ClassTypes. For more information about relationship types, see RelationshipTypes.
Type Definition
<DataSourceModuleType ID="Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper" Accessibility="Public" Batching="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.Discovery.MapperSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="NameSpace" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="Query" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="Frequency" type="xsd:unsignedInt" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="ClassId" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="ClassInstanceSettings" type="SettingsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="RelationshipId" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="RelationshipInstanceSettings" minOccurs="0" maxOccurs="1" type="SettingsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="SourceTypeId" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="SourceRoleSettings" minOccurs="0" maxOccurs="1" type="SettingsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="TargetTypeId" type="xsd:string" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
<xsd:element name="TargetRoleSettings" minOccurs="0" maxOccurs="1" type="SettingsType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int" />
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.Discovery.Scheduler">
<Scheduler>
<SimpleReccuringSchedule>
<Interval Unit="Seconds">$Config/Frequency$</Interval>
</SimpleReccuringSchedule>
<ExcludeDates />
</Scheduler>
</DataSource>
<ProbeAction ID="Probe" TypeID="Microsoft.Windows.WmiProbe">
<NameSpace>$Config/NameSpace$</NameSpace>
<Query>$Config/Query$</Query>
</ProbeAction>
<ConditionDetection ID="Mapper" TypeID="System!System.Discovery.ClassAndRelationshipSnapshotDataMapper">
<ClassId>$Config/ClassId$</ClassId>
<ClassInstanceSettings>$Config/ClassInstanceSettings$</ClassInstanceSettings>
<RelationshipId>$Config/RelationshipId$</RelationshipId>
<RelationshipInstanceSettings>$Config/RelationshipInstanceSettings$</RelationshipInstanceSettings>
<SourceTypeId>$Config/SourceTypeId$</SourceTypeId>
<SourceRoleSettings>$Config/SourceRoleSettings$</SourceRoleSettings>
<TargetTypeId>$Config/TargetTypeId$</TargetTypeId>
<TargetRoleSettings>$Config/TargetRoleSettings$</TargetRoleSettings>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="Mapper">
<Node ID="Probe">
<Node ID="Scheduler" />
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>
Parameters
The Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper module supports the following configuration parameters.
| Parameter | Type | Description |
|---|---|---|
|
NameSpace |
String |
Required parameter. Specifies the WMI namespace within which the module is to run the query. |
|
Query |
String |
Required parameter. Specifies the SELECT WMI query to run. |
|
Frequency |
Integer |
Required parameter. Specifies the frequency in seconds at which to run the WMI query. |
|
ClassId |
String |
Required parameter. Specifies the ID of the class type into which the WMI object is to be mapped. This will typically be in the following format: $MPElement[Name="ClassTypeID"]$. |
|
ClassInstanceSettings |
Required parameter. Defines all property values of the discovered class type instances. This must at least include the values of the instance’s key properties. |
|
|
RelationshipId |
String |
Required parameter. Specifies the ID of the relationship type into which the WMI object is to be mapped. This will typically be in the following format: $MPElement[Name="RelationshipTypeID"]$. |
|
RelationshipInstanceSettings |
Optional parameter. Defines all property values of the discovered relationship type instances. This will typically be empty because most relationship instances will not have properties. |
|
|
SourceTypeId |
String |
Optional parameter. Specifies the ID of the Source class type in the relationship type into which the WMI object is to be mapped. |
|
SourceRoleSettings |
Optional parameter. Defines the key property values for the source class type instance in the relationship. This will only be empty if the source of the relationship is a singleton class. |
|
|
TargetTypeId |
String |
Optional parameter. Specifies the ID of the Target class type in the relationship type into which the WMI object is to be mapped. |
|
TargetRoleSettings |
Optional parameter. Defines the key property values for the target class type instance in the relationship. This will only be empty if the target of the relationship is a singleton class. |
Composition
The Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper module is a composite module that contains the member modules that are described in the following table.
| Workflow Run Order | Module Type | Usage |
|---|---|---|
|
1 |
Outputs System.Discovery.Data data on a scheduled, repeating interval. Used only in discovery data source module types. |
|
|
2 |
Returns the queried WMI object data as System.PropertyBagData and passes it on to the subsequent mapping module. |
|
|
3 |
System.Discovery.ClassAndRelationshipSnapshotDataMapper |
Maps the received System.PropertyBagData data into class and relationship type data as System.Discovery.Data. |
Related Modules
| Module Type | Usage |
|---|---|
|
Queries WMI for object and single property data at a scheduled, recurring interval and returns the results as System.Discovery.Data type data. |
|
|
Queries WMI for object data at a scheduled, recurring interval and returns the discovered class type instance as System.Discovery.Data type. |
|
|
Microsoft.Windows.WmiProviderWithRelationshipSnapshotDataMapper |
Queries WMI for object data at a scheduled, recurring interval and returns the discovered relationship type instance as System.Discovery.Data type. |
External Module References
None
Sample
The following example uses the Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper module in a discovery that uses WMI. The source of the relationship is a class called MyClass, and the target is Microsoft.Windows.Server.2008.LogicalDisk. This discovery discovers instances of both MyClass and the relationship MyClassContainsLogicalDisk.
<Discovery ID="MPAuthor.WMIRelationship.DiscoverMyClass" Enabled="true" Target="MPAuthor.WMIRelationship.Target" ConfirmDelivery="true" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="MPAuthor.WMIRelationship.MyClass" />
<DiscoveryRelationship TypeID="MPAuthor.WMIRelationship.MyClassContainsLogicalDisk" />
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassAndRelationshipSnapshotDataMapper">
<NameSpace>root\cimv2</NameSpace>
<Query>select * from win32_logicaldisk</Query>
<Frequency>120</Frequency>
<ClassId>$MPElement[Name="MPAuthor.WMIRelationship.MyClass"]$</ClassId>
<ClassInstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
</Settings>
</ClassInstanceSettings>
<RelationshipId>$MPElement[Name="MPAuthor.WMIRelationship.MyClassContainsLogicalDisk"]$</RelationshipId>
<SourceTypeId>$MPElement[Name="MPAuthor.WMIRelationship.MyClass"]$</SourceTypeId>
<SourceRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
</Settings>
</SourceRoleSettings>
<TargetTypeId>$MPElement[Name="MicrosoftWindowsServer2008Discovery!Microsoft.Windows.Server.2008.LogicalDisk"]$</TargetTypeId>
<TargetRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.LogicalDevice"]/DeviceID$</Name>
<Value>$Data/Property[@Name='DeviceID']$</Value>
</Setting>
</Settings>
</TargetRoleSettings>
</DataSource>
</Discovery>
Information
|
Module Type |
|
|
Input Type |
None |
|
Output Type |
|
|
Implementation |
Composite |
|
Library |
Microsoft.Windows.Library |