WriteAction (Task)

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

Represents an implementation of a write action module type definition.

Schema Hierarchy

ManagementPack
  Monitoring
    Tasks
      Task
        Category (Task)

Syntax

<WriteAction ID=”ModuleID” Comment=”Comment” TypeID=”ModuleTypeID”>
Custom Schema Defined Parameters
</WriteAction>

Attributes and Elements

The following sections describe attributes, child elements, and the parent element of the WriteAction element.

Attributes

Attribute Description

ID

Required attribute. Represents the identity of the element.

Comment

Optional attribute. Represents commentary by the management pack author.

TypeID

Required attribute. Represents a WriteAction module type definition from which this WriteAction module inherits its configuration schema.

ID Attribute Values

Value Description

The format for the ID attribute should be UniqueElementID.

The ID string must contain the following characteristics:

  • The length is less than 255 characters.

  • The ID begins with a letter (a-z) or a number (0-9).

  • The ID contains only letters, numbers, the period character (.), or the underscore (_) character.

  • The ID is unique across all elements within the scope of the WriteAction module’s containing workflow.

  • The ID is case-sensitive.

Child Elements

The child element of the WriteAction module is defined by the configuration schema of its base type as referenced in the TypeID attribute.

Parent Elements

Element Description

Task

Contains one or more write action modules.

Remarks

A WriteAction module takes a single input data stream. It uses this data stream, perhaps in conjunction with some kind of condition detection, to affect system state in some way. This change could be in the monitored system or in Operations Manager itself. For example, a write action module might run a script that changes something, writes data into the Operations Manager database, or generates an alert. 

A write action module’s base type must always be a descendant of a WriteActionModuleType type. Write action modules are used only at the end of a workflow because they do not return data for processing to another module. When they do return data, they do so only so that it can be sent to the Operations database or to standard output.

Example

The following XML sample illustrates a task that performs a write action to start the LanmanServer service on the target’s host computer.

<Task ID="Microsoft.Windows.Server.2008.OperatingSystem.StartServerService.Task" Accessibility="Public" Enabled="true" Target="Server2008!Microsoft.Windows.Server.2008.OperatingSystem" Timeout="600" Remotable="true">
  <Category>Maintenance</Category>
  <WriteAction ID="WA" TypeID="WindowsServer!Microsoft.Windows.Server.StartServiceViaWMI.ModuleType">
    <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
    <ServiceName>LanmanServer</ServiceName>
  </WriteAction>
</Task>

See Also

Reference

Task
WriteActionModuleType