Share via


Microsoft.Windows.RegistryProbe

Applies To: System Center 2012 - Operations Manager, System Center 2012 R2 Operations Manager, System Center 2012 SP1 - Operations Manager

The Microsoft.Windows.RegistryProbe probe action module type is used to gather data from the Windows registry. The module returns the registry data as Microsoft.Windows.RegistryData data.

Usage

Use this module when you want to gather data from the Windows registry on a monitored computer. The module gathers one or more keys or values from the registry and provides them as a single Microsoft.Windows.RegistryData data item. 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 by the probe.

Type Definition

<ProbeActionModuleType ID="Microsoft.Windows.RegistryProbe" Accessibility="Public">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>Microsoft.Windows.RegistryAttributeDefinitionsSchema</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="ComputerName" type="xsd:string" />
    <xsd:element name="RegistryAttributeDefinitions" type="RegistryAttributeDefinitionsType" />
  </Configuration>
  <ModuleImplementation>
    <Native>
      <ClassID>472364F2-A1F0-41C0-9A8F-E00C92C2AB31</ClassID>
    </Native>
  </ModuleImplementation>
  <OutputType>Microsoft.Windows.RegistryData</OutputType>
  <InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>

Parameters

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

Parameter Type Description

ComputerName

String

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

RegistryAttributeDefinitions

RegistryAttributeDefinitionsType

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

ComputerName

The ComputerName configuration is most commonly passed to the module by using the $Target notation, although it can be specified as any string. The module attempts to connect to either the local computer’s registry or a remote computer’s registry, depending on the configuration that is passed. For a workflow that is targeted at a Windows-based computer, the ComputerName value is specified in the following code example:

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

If the target is a class that is hosted by a computer, hosting references are added as required, as in the following example:

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

For more information about the RegistryAttributeDefinitions element, see RegistryAttributeDefinitionsType.

Composition

The Microsoft.Windows.RegistryProbe module is a native module.

Errors

The errors listed in the following table can occur from within the Microsoft.Windows.RegistryProbe module.

Exception Reason

31901

The module failed to connect to the registry.

31903

The module failed to collect the some attributes from the registry.

Module Type Usage

Microsoft.Windows.RegistryTriggerProbe

Queries the Windows registry and returns the data as Microsoft.Windows.RegistryData data. This module is trigger-only.

External Module References

The Microsoft.Windows.RegistryProbe module is a member of the following modules:

Module Type Library Usage

Microsoft.Windows.ExistingWin32ServiceInformationProbe

Microsoft.Windows.Library

Used to query installed-only Windows service information from the Service Control Manager. Returns System.PropertyBagData data.

Microsoft.Windows.RegistryProvider

Microsoft.Windows.Library

Queries the Windows registry at a scheduled frequency and returns the results as Microsoft.Windows.RegistryData data.

Microsoft.Windows.RegistryProviderSingle

Microsoft.Windows.Library

Queries the Windows registry for a single key or value at a scheduled frequency and returns the results as Microsoft.Windows.RegistryData data.

Microsoft.Windows.Discovery.RegistryProvider

Microsoft.Windows.Library

Queries Windows registry keys or values and returns Microsoft.Windows.RegistryData data. This should be used only from within a data source module type definition that returns discovery data.

Microsoft.Windows.Discovery.RegistryProviderSingle

Microsoft.Windows.Library

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.

Sample

The following XML sample shows an example of a task that uses the Microsoft.Windows.RegistryProbe probe module to return a set of values from the registry:


<Task ID="Microsoft.Samples.GetRegistryData" Accessibility="Internal" Target="Microsoft.Samples.ApplicationX">
  <Category>Operations</Category>
  <ProbeAction ID="RegistryProbe" TypeID="Windows!Microsoft.Windows.RegistryProbe">
    <ComputerName>$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/NetworkName$</ComputerName>
    <RegistryAttributeDefinitions>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXExists</AttributeName>
        <Path>SOFTWARE\OpsMgrSamples\ApplicationX</Path>
        <PathType>0</PathType>
        <AttributeType>0</AttributeType>
      </RegistryAttributeDefinition>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXVersion</AttributeName>
        <Path>SOFTWARE\OpsMgrSamples\ApplicationX\Version</Path>
        <PathType>1</PathType>
        <AttributeType>1</AttributeType>
      </RegistryAttributeDefinition>
      <RegistryAttributeDefinition>
        <AttributeName>ApplicationXPath</AttributeName>
        <Path>SOFTWARE\OpsMgrSamples\ApplicationX\Path</Path>
        <PathType>1</PathType>
        <AttributeType>1</AttributeType>
      </RegistryAttributeDefinition>
    </RegistryAttributeDefinitions>
  </ProbeAction>
</Task>

This results in the following data item:


<DataItem type="Microsoft.Windows.RegistryData" time="2008-10-08T13:08:26.9989812-07:00" sourceHealthServiceId="B0BE86FA-56AD-1F2E-EE87-8DF72FC53818">
  <Values>
    <ApplicationXExists VariantType="11" Type="Boolean">true</ApplicationXExists>
    <ApplicationXPath VariantType="8">c:\ApplicationX</ApplicationXPath>
    <ApplicationXVersion VariantType="8">2.0</ApplicationXVersion>
  </Values>
</DataItem>

Information

   

Module Type

ProbeActionModuleType

Input Type

None

Output Type

Microsoft.Windows.RegistryData

Implementation

Native

Library

Microsoft.Windows.Library