DPM server availability module

Microsoft.SystemCenter.DataProtectionManager.2011.Discovery.DPMServerAvailabilityModule (ProbeActionModuleType)

DPM server availability module.

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
DPMServerAvailability ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default

Source Code:

<ProbeActionModuleType ID="Microsoft.SystemCenter.DataProtectionManager.2011.Discovery.DPMServerAvailabilityModule" Accessibility="Internal" Batching="false" PassThrough="false">
<Configuration>
<xsd:element minOccurs="1" name="ComputerName" type="xsd:string"/>
</Configuration>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="DPMServerAvailability" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>DPMServerAvailability.ps1</ScriptName>
<ScriptBody><Script>
param($computerName)

# Load DPM snapin
$dpmBinPath = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Microsoft Data Protection Manager\Setup" "UIInstallPath").UIInstallPath
. "$dpmBinPath\GlobalFunctions.ps1"
LoadDPMSnapin

$api = new-object -comObject 'MOM.ScriptAPI'
$api.LogScriptEvent('DPMServerAvailability.ps1 - DPM heart beat check',20,4,$computerName)

$bag = $api.CreatePropertyBag()

$bag.AddValue('ComputerName',$computerName)

$dpmServer = Connect-DPMServer $computerName

if ($dpmServer)
{
$bag.AddValue('Result','Good')
}
else
{
$bag.AddValue('Result','Bad')
}

$bag
</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>ComputerName</Name>
<Value>$Config/ComputerName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>1800</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="DPMServerAvailability"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>