Log Event Write Action

Microsoft.SystemCenter.AgentManagement.LogEvent (WriteActionModuleType)

Log Event Write Action Module type.

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsSystem.PrivilegedMonitoringAccount
InputTypeSystem.TriggerData

Member Modules:

ID Module Type TypeId RunAs 
LogEvent WriteAction System.CommandExecuter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
TimeoutSecondsint$Config/TimeoutSeconds$Timeout Seconds

Source Code:

<WriteActionModuleType ID="Microsoft.SystemCenter.AgentManagement.LogEvent" Accessibility="Internal" RunAs="System!System.PrivilegedMonitoringAccount" Batching="false">
<Configuration>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="LogEvent" TypeID="System!System.CommandExecuter">
<ApplicationName>%windir%\system32\windowspowershell\v1.0\powershell.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>-NoLogo -Command "&amp; '$File/LogEndToEndEvent.ps1$'"</CommandLine>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>LogEndToEndEvent.ps1</Name>
<Contents><Script>
$oAPI = new-object -comobject "MOM.ScriptAPI"

$SCRIPT_NAME = "LogEndToEndEvent.ps1";
$ENU_MESSAGE = "This event is logged to the Windows Event Log periodically to test a event collection.";

$EVENTLOG_SUCCESS = 0x0000; #Information event
$EVENTLOG_AUDIT_FAILURE = 0x0010; #Failure Audit event
$EVENTLOG_AUDIT_SUCCESS = 0x0008; #Success Audit event
$EVENTLOG_ERROR_TYPE = 0x0001; #Error event
$EVENTLOG_INFORMATION_TYPE = 0x0004; #Information event
$EVENTLOG_WARNING_TYPE = 0x0002; #Warning event

$oAPI.LogScriptEvent($SCRIPT_NAME, 6022, $EVENTLOG_INFORMATION_TYPE, $ENU_MESSAGE);

</Script></Contents>
<Unicode>true</Unicode>
</File>
</Files>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="LogEvent"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>System!System.TriggerData</InputType>
</WriteActionModuleType>