Microsoft.Windows.Discovery.RegistryProvider

System Center

Updated: August 10, 2011

Applies To: Operations Manager 2007 R2

The Microsoft.Windows.Discovery.RegistryProvider module is a discovery data source module type that queries the Windows registry at a scheduled frequency and returns the results as Microsoft.Windows.RegistryData type data.

Usage

Use this module when you want to query the Windows registry inside a discovery workflow. This module supports retrieving any key or value from the HKEY_LOCAL_MACHINE hive of the registry only. For multi-string values, only the first string is returned. Using this module in any workflow other than a discovery workflow can cause serious performance degradation.

ImportantImportant
This module does not return System.Discovery.Data data. To function within a discovery, it must be included as a member module within a custom composite DataSourceModuleType definition that returns discovery data. In general, the Microsoft.Windows.RegistryDiscoveryProvider discovery data source module, which already contains Microsoft.Windows.Discovery.RegistryProvider as a member module, suffices in most workflows.

Type Definition


<DataSourceModuleType ID="Microsoft.Windows.Discovery.RegistryProvider" Accessibility="Public">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>Microsoft.Windows.RegistryAttributeDefinitionsSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="ComputerName" type="xsd:string" />
    <xsd:element name="RegistryAttributeDefinitions" type="RegistryAttributeDefinitionsType" />
    <xsd:element name="Frequency" type="xsd:unsignedInt" />
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int" />
  </OverrideableParameters>
  <ModuleImplementation>
    <Composite>
      <MemberModules>
        <DataSource TypeID="System!System.Discovery.Scheduler" ID="Scheduler">
          <Scheduler>
            <SimpleReccuringSchedule>
              <Interval Unit="Seconds">$Config/Frequency$</Interval>
            </SimpleReccuringSchedule>
            <ExcludeDates />
          </Scheduler>
        </DataSource>
        <ProbeAction TypeID="Microsoft.Windows.RegistryProbe" ID="Probe">
          <ComputerName>$Config/ComputerName$</ComputerName>
          <RegistryAttributeDefinitions>$Config/RegistryAttributeDefinitions$</RegistryAttributeDefinitions>
        </ProbeAction>
      </MemberModules>
      <Composition>
        <Node ID="Probe">
          <Node ID="Scheduler" />
        </Node>
      </Composition>
    </Composite>
  </ModuleImplementation>
  <OutputType>Microsoft.Windows.RegistryData</OutputType>
</DataSourceModuleType>

Parameters

The Microsoft.Windows.Discovery.RegistryProvider module supports the configuration parameters described in the following table.

 

Parameter Type Overrideable Description

ComputerName

String

False

Required parameter. The name of the computer from which to query the registry.

RegistryAttributeDefinitions

RegistryAttributeDefinitionsType

False

Required parameter. The set of keys and values to gather from the registry.

Frequency

Unsigned Integer

True

Required parameter. Specifies the frequency, in seconds, at which to run the query over the Windows registry.

For more information about the ComputerName parameter, see the Microsoft.Windows.RegistryProbe module.

For more information about the RegistryAttributeDefinitions parameter, see RegistryAttributeDefinitionsType.

For more information about the Frequency parameter, see the System.Discovery.Scheduler module.

Composition

The Microsoft.Windows.Discovery.RegistryProvider module is a composite module that contains the member modules described in the following table.

 

Workflow Run Order Module Type Usage

1

System.Discovery.Scheduler

Triggers the subsequent probe module to run at a scheduled, recurring interval in discovery workflows.

2

Microsoft.Windows.RegistryProbe

Runs the query on the Windows registry and returns Microsoft.Windows.RegistryData data.

Related Modules

 

Module Type Usage

Microsoft.Windows.RegistryProvider

Queries Windows registry values or keys and returns Microsoft.Windows.RegistryData data.

Microsoft.Windows.Discovery.RegistryProviderSingle

Queries a single Windows registry value or key and returns Microsoft.Windows.RegistryData data.

Microsoft.Windows.Discovery.RegistryProviderSingle

Queries a single Windows registry key or value and returns Microsoft.Windows.RegistryData data. This type has simpler configuration, but only a single value or key can be specified. This should be used only from within a data source module type definition that returns discovery data.

Microsoft.Windows.FilteredRegistryDiscoveryProvider

Queries the Windows registry on a timed interval and returns System.Discovery.Data data. This type takes an expression to filter data on.

Microsoft.Windows.RegistryDiscoveryProvider

Queries the Windows registry and returns System.Discovery.Data data. No filtering of data is provided in this module type. This should be used only when you know that the registry keys and values will always be present.

Microsoft.Windows.RegistryDiscoverySingleProvider

Queries the Windows registry for a single key or value and returns System.Discovery.Data data. No filtering of data is provided in this module type. This should be used only when you know that the registry keys and values will always be present.

External Module References

The Microsoft.Windows.Discovery.RegistryProvider module is a member of the modules described in the following table.

 

Module Type Library Usage

Microsoft.Windows.RegistryDiscoveryProvider

Microsoft.Windows.Library

Queries the Windows registry and returns System.Discovery.Data data. No filtering of data is provided in this module type. This should be used only when you know that the registry keys and values will always be present.

Microsoft.Windows.FilteredRegistryDiscoveryProvider

Microsoft.Windows.Library

Queries the Windows registry on a timed interval and returns System.Discovery.Data data. This type takes an expression to filter data on.

Sample

The following XML sample shows an example of a discovery that uses the Microsoft.Windows.Discovery.RegistryProvider module to discovery a class instance at the specified interval.

The following section of this sample shows how the Microsoft.Windows.FilteredRegistryDiscoveryProvider discovery module defines Microsoft.Windows.Discovery.RegistryProvider as a member module.


<DataSourceModuleType ID="Microsoft.Windows.FilteredRegistryDiscoveryProvider" Accessibility="Public">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>Microsoft.Windows.RegistryAttributeDefinitionsSchema</SchemaType>
      <SchemaType>System!System.Discovery.MapperSchema</SchemaType>
      <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="ComputerName" type="xsd:string" />
    <xsd:element name="RegistryAttributeDefinitions" type="RegistryAttributeDefinitionsType" />
    <xsd:element name="Frequency" type="xsd:unsignedInt" />
    <xsd:element name="ClassId" type="xsd:string" />
    <xsd:element name="InstanceSettings" minOccurs="0" maxOccurs="1" type="SettingsType" />
    <xsd:element name="Expression" type="ExpressionType" />
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="Frequency" Selector="$Config/Frequency$" ParameterType="int" />
  </OverrideableParameters>
  <ModuleImplementation>
    <Composite>
      <MemberModules>
        <DataSource ID="DS" TypeID="Microsoft.Windows.Discovery.RegistryProvider">
          <ComputerName>$Config/ComputerName$</ComputerName>
          <RegistryAttributeDefinitions>$Config/RegistryAttributeDefinitions$</RegistryAttributeDefinitions>
          <Frequency>$Config/Frequency$</Frequency>
        </DataSource>
        <ConditionDetection ID="Mapping" TypeID="System!System.Discovery.FilteredClassSnapshotDataMapper">
          <Expression>$Config/Expression$</Expression>
          <ClassId>$Config/ClassId$</ClassId>
          <InstanceSettings>$Config/InstanceSettings$</InstanceSettings>
        </ConditionDetection>
      </MemberModules>
      <Composition>
        <Node ID="Mapping">
          <Node ID="DS" />
        </Node>
      </Composition>
    </Composite>
  </ModuleImplementation>
  <OutputType>System!System.Discovery.Data</OutputType>
</DataSourceModuleType>



The next section of this sample shows how the above data source module type is implemented within a discovery workflow.

<Discovery ID="Microsoft.Samples.ApplicationX.Discovery" Target="Windows!Microsoft.Windows.Server.Computer" Remotable="true" Enabled="true">
  <Category>Discovery</Category>
  <DiscoveryTypes>
    <DiscoveryClass TypeID="Microsoft.Samples.ApplicationX">
      <Property PropertyID="Version"/>
      <Property PropertyID="Path"/>
      <Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
    </DiscoveryClass>
  </DiscoveryTypes>
  <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider ">
   <ComputerName>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
    <RegistryAttributeDefinitions>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXExists</AttributeName>
        <Path>SOFTWARE\MicrosoftSamples\ApplicationX</Path>
        <PathType>0</PathType>
        <AttributeType>0</AttributeType>
      </RegistryAttributeDefinition>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXVersion</AttributeName>
        <Path>SOFTWARE\MicrosoftSamples\ApplicationX\Version</Path>
        <PathType>1</PathType>
        <AttributeType>1</AttributeType>
      </RegistryAttributeDefinition>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXPath</AttributeName>
        <Path>SOFTWARE\MicrosoftSamples\ApplicationX\Path</Path>
        <PathType>1</PathType>
        <AttributeType>1</AttributeType>
      </RegistryAttributeDefinition>
    </RegistryAttributeDefinitions>
    <Frequency>1800</Frequency>
    <ClassId>$MPElement[Name="Microsoft.Samples.ApplicationX"]$</ClassId>
    <InstanceSettings>
      <Settings>
        <Setting>
          <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
          <Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
          <Value>Application X ($Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetbiosComputerName$)</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="Microsoft.Samples.ApplicationX"]/Version$</Name>
          <Value>$Data/Values/ApplicationXVersion$</Value>
        </Setting>
        <Setting>
          <Name>$MPElement[Name="Microsoft.Samples.ApplicationX"]/Path$</Name>
          <Value>$Data/Values/ApplicationXPath$</Value>
        </Setting>
      </Settings>
    </InstanceSettings>
   </DataSource>
</Discovery>

Information

 

   

Module Type

DataSourceModuleType

Input Type

None

Output Type

Microsoft.Windows.RegistryData

Implementation

Composite

Library

Microsoft.Windows.Library

 
Show: