다음을 통해 공유


Microsoft.SystemCenter.WSManagement.TimedEnumerator

Applies To: Operations Manager 2007 R2

The Microsoft.SystemCenter.WSManagement.TimedEnumerator data source module type calls the WS-Management Enumerate operation on a WS-Management resource on a scheduled interval. This module returns the results of the enumeration as Microsoft.SystemCenter.WSManagement.WSManData.

Usage

Use this module to enumerate instances of a WS-Management resource and return the results at a scheduled frequency from within a workflow.

Type Definition

<DataSourceModuleType ID="Microsoft.SystemCenter.WSManagement.TimedEnumerator" Accessibility="Public" RunAs="Microsoft.SystemCenter.WSManagement.WSManActionAccount" Batching="false">
  <Configuration>
    <IncludeSchemaTypes>
      <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
      <SchemaType>Microsoft.SystemCenter.WSManagement.Schemas</SchemaType>
    </IncludeSchemaTypes>
    <xsd:element name="Scheduler" type="PublicSchedulerType" />
    <xsd:element name="Enumerate" type="EnumerateSchema" />
  </Configuration>
  <OverrideableParameters>
    <OverrideableParameter ID="Protocol" Selector="$Config/Enumerate/Protocol$" ParameterType="string" />
    <OverrideableParameter ID="TargetSystem" Selector="$Config/Enumerate/TargetSystem$" ParameterType="string" />
    <OverrideableParameter ID="Port" Selector="$Config/Enumerate/Port$" ParameterType="int" />
    <OverrideableParameter ID="Authentication" Selector="$Config/Enumerate/Authentication$" ParameterType="string" />
    <OverrideableParameter ID="UserName" Selector="$Config/Enumerate/UserName$" ParameterType="string" />
    <OverrideableParameter ID="Password" Selector="$Config/Enumerate/Password$" ParameterType="string" />
    <OverrideableParameter ID="SkipCACheck" Selector="$Config/Enumerate/SkipCACheck$" ParameterType="bool" />
    <OverrideableParameter ID="SkipCNCheck" Selector="$Config/Enumerate/SkipCNCheck$" ParameterType="bool" />
    <OverrideableParameter ID="OutputErrorIfAny" Selector="$Config/Enumerate/OutputErrorIfAny$" ParameterType="bool" />
    <OverrideableParameter ID="UTF" Selector="$Config/Enumerate/UTF$" ParameterType="string" />
    <OverrideableParameter ID="Uri" Selector="$Config/Enumerate/Uri$" ParameterType="string" />
    <OverrideableParameter ID="Filter" Selector="$Config/Enumerate/Filter$" ParameterType="string" />
    <OverrideableParameter ID="TimeOutInMS" Selector="$Config/Enumerate/TimeOutInMS$" ParameterType="int" />
    <OverrideableParameter ID="SplitItems" Selector="$Config/Enumerate/SplitItems$" ParameterType="bool" />
  </OverrideableParameters>
  <ModuleImplementation Isolation="Any">
    <Composite>
      <MemberModules>
        <DataSource ID="Scheduler" TypeID="System!System.Scheduler">
          <Scheduler>$Config/Scheduler$</Scheduler>
        </DataSource>
        <ProbeAction ID="Enumerator" TypeID="Microsoft.SystemCenter.WSManagement.Enumerator">
          <Enumerate>$Config/Enumerate$</Enumerate>
        </ProbeAction>
      </MemberModules>
      <Composition>
        <Node ID="Enumerator">
          <Node ID="Scheduler" />
        </Node>
      </Composition>
    </Composite>
  </ModuleImplementation>
  <OutputType>Microsoft.SystemCenter.WSManagement.WSManData</OutputType>
</DataSourceModuleType>

Parameters

The Microsoft.SystemCenter.WSManagement.TimedEnumerator module supports the configuration parameters described in the following table.

Parameter Type Overrideable Description

Scheduler

PublicSchedulerType

False

Represents the schedule by which to trigger the Enumerate operation.

Enumerate

EnumerateSchema

False

Contains the schema used to specify the set of properties required to perform a WS-Management Enumerate operation.

All of the sub-elements in the Enumerate parameter are marked as overrideable.

For more information about the Enumerate parameter, see EnumerateSchema.

For more information about the Scheduler parameter, see PublicSchedulerType.

Composition

The Microsoft.SystemCenter.WSManagement.TimedEnumerator module is a composite module that contains the member modules described in the following table.

Workflow Run Order Module Type Usage

1

System.Scheduler

Outputs System.Discovery.Data data on a scheduled, repeating interval and triggers the subsequent probe action to run the Enumerate operation.

2

Microsoft.SystemCenter.WSManagement.Enumerator

Returns the results of the Enumerate operation.

Module Type Usage

Microsoft.SystemCenter.WSManagement.Invoker

A probe action module type that performs a WS-Management Invoke operation.

Microsoft.SystemCenter.WSManagement.Getter

A probe action module type that performs a WS-Management Get operation.

Microsoft.SystemCenter.WSManagement.TimedGetter

A data source module type that performs a scheduled WS-Management Get operation.

Microsoft.SystemCenter.WSManagement.TimedInvoker

A data source module type that performs a scheduled WS-Management Invoke operation.

External Module References

None.

Remarks

For remarks, see the Microsoft.SystemCenter.WSManagement.Getter module type.

Sample

The following XML sample demonstrates a rule that enumerates all running auto-start instances of the Win32_Service resource on the target computer. The rule generates an alert for each auto-start instance that is not currently running.

<Rule ID="Microsoft.Samples.TimedEnumerator" Target="Windows!Microsoft.Windows.Computer" Enabled="true" ConfirmDelivery="true">
  <Category>Custom</Category>
   <DataSources>
     <DataSource ID="SR" TypeID="WSManLibrary!Microsoft.SystemCenter.WSManagement.TimedEnumerator">
      <Scheduler>
        <SimpleReccuringSchedule>
          <Interval Unit="Hours">24</Interval>
        </SimpleReccuringSchedule>
        <ExcludeDates/>
      </Scheduler>
    <Enumerate>
      <Protocol>http</Protocol>
      <TargetSystem>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</TargetSystem>
      <Port>80</Port>
      <Authentication>kerberos</Authentication>
      <UserName />
      <Password />
      <SkipCACheck>true</SkipCACheck>
      <SkipCNCheck>true</SkipCNCheck>
      <UTF>utf-8</UTF>
      <Uri>https://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service </Uri>
      <Filter>SELECT * FROM Win32_Service WHERE State=’Running'</Filter>
      <TimeOutInMS>2000</TimeOutInMS>
      <SplitItems>true</SplitItems>
    </Enumerate>
    </DataSource>
  </DataSources>
  <ConditionDetection ID=”Filter” TypeID=”System!System.ExpressionFilter”>
    <Expression>
     <And>
       <SimpleExpression>
        <ValueExpression>
          <XPathQuery Type="String">p:State</XPathQuery>
        </ValueExpression>
        <Operator>NotEqual</Operator>
        <ValueExpression>
          <Value Type="String">Running</Value>
        </ValueExpression>
       </SimpleExpression>
       <SimpleExpression>
        <ValueExpression>
          <XPathQuery Type="String">p:StartMode</XPathQuery>
        </ValueExpression>
        <Operator>Equal</Operator>
        <ValueExpression>
          <Value Type="String">Auto</Value>
        </ValueExpression>
      </SimpleExpression>
    </Expression>
   </And>
  </ConditionDetection>
  <WriteActions>
    <WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
      <Priority>1</Priority>
      <Severity>1</Severity>
      <AlertMessageId>$MPElement[Name="Microsoft.Samples.AlertMessage"]$</AlertMessageId>
      <AlertParameters>
        <AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
        <AlertParameter2>$Data/p:PathName$</AlertParameter2>
      </AlertParameters>
      <Suppression>
        <SuppressionValue />
      </Suppression>
    </WriteAction>
  </WriteActions>
</Rule>

The following section shows data item output from the rule in the preceding section of this sample.

<DataItem type ="Microsoft.SystemCenter.WSManagement.WSManData" time =" 2008-10-23T11:12:51.1451250-04:00 " sourceHealthServiceId =" CC9FCD47-4887-8AE7-A72F-2EACF9C2F1D9 ">
 <WsManData>
 <p:Win32_Service xsi:type ="p:Win32_Service_Type" xml:lang ="en-US">
  <p:AcceptPause>false</p:AcceptPause>
  <p:AcceptStop>true</p:AcceptStop>
  <p:Caption>Print Spooler</p:Caption>
  <p:CheckPoint>0</p:CheckPoint>
  <p:CreationClassName>Win32_Service</p:CreationClassName>
  <p:Description>Manages all local and network print queues and controls all printing jobs. If this service is stopped, printing on the local machine will be unavailable. If this service is disabled, any services that explicitly depend on it will fail to start.</p:Description>
  <p:DesktopInteract>true</p:DesktopInteract>
  <p:DisplayName>Print Spooler</p:DisplayName>
  <p:ErrorControl>Normal</p:ErrorControl>
  <p:ExitCode>0</p:ExitCode>
  <p:InstallDate xsi:nil =" true " />
  <p:Name>spooler</p:Name>
  <p:PathName>C:\WINDOWS\system32\spoolsv.exe</p:PathName>
  <p:ProcessId>1252</p:ProcessId>
  <p:ServiceSpecificExitCode>0</p:ServiceSpecificExitCode>
  <p:ServiceType>Own Process</p:ServiceType>
  <p:Started>true</p:Started>
  <p:StartMode>Auto</p:StartMode>
  <p:StartName>LocalSystem</p:StartName>
  <p:State>Stopped</p:State>
  <p:Status>OK</p:Status>
  <p:SystemCreationClassName>Win32_ComputerSystem</p:SystemCreationClassName>
  <p:SystemName>RED-DC-01</p:SystemName>
  <p:TagId>0</p:TagId>
  <p:WaitHint>0</p:WaitHint>
 </p:Win32_Service>
  </WsManData>
 </DataItem>

Information

   

Module Type

DataSourceModuleType

Input Type

None.

Output Type

Microsoft.SystemCenter.WSManagement.WSManData

Implementation

Composite

Library

Microsoft.SystemCenter.WSManagement.Library