Veeam MM Event Module

Veeam.Virt.Extensions.VMware.Integration.MaintenanceMode.CreateRecoveryEvent (WriteActionModuleType)

Veeam MM Event Write Action Module

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.CommandOutput

Member Modules:

ID Module Type TypeId RunAs 
Recovery WriteAction Microsoft.Windows.ScriptWriteAction Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
hoursstring$Config/hours$hours
reasonstring$Config/reason$reason
commentstring$Config/comment$comment

Source Code:

<WriteActionModuleType ID="Veeam.Virt.Extensions.VMware.Integration.MaintenanceMode.CreateRecoveryEvent" Accessibility="Internal" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="eventId" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="hostName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="hours" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="state" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="reason" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="comment" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="hours" Selector="$Config/hours$" ParameterType="string"/>
<OverrideableParameter ID="reason" Selector="$Config/reason$" ParameterType="string"/>
<OverrideableParameter ID="comment" Selector="$Config/comment$" ParameterType="string"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="Recovery" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>LogMMEvent.js</ScriptName>
<Arguments>$Config/eventId$ $Config/hostName$ $Config/hours$ $Config/state$ "$Config/reason$" "$Config/comment$"</Arguments>
<ScriptBody><Script>var SCRIPT_NAME = "LogMMEvent.js";
var SEVERITY_ERROR = 1;
var SEVERITY_WARNING = 2;
var SEVERITY_INFO = 4;
var momApi = new ActiveXObject("MOM.ScriptAPI");

if (WScript.Arguments.length == 0)
WScript.Quit(0);

var eventId = WScript.Arguments(0);

var msg = "";
for (var i = 1; i &lt; WScript.Arguments.length; i++) {
msg += WScript.Arguments(i);
if (i != WScript.Arguments.length - 1)
msg += "*";
}

LogScriptEvent(msg, SEVERITY_INFO);

function LogScriptEvent(message_in, severity_in) {
momApi.LogScriptEvent(SCRIPT_NAME, eventId, severity_in, message_in);
}
</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="Recovery"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.CommandOutput</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>