<ProbeActionModuleType ID="ConfigMgr.2012.Client.Library.Check.Active.MP.Candidate.Probe" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation>
<Composite>
<MemberModules>
<ProbeAction ID="Script" TypeID="Windows!Microsoft.Windows.ScriptPropertyBagProbe">
<ScriptName>CM12ClientActiveMPCandidateProbe.vbs</ScriptName>
<Arguments>$Config/ComputerName$</Arguments>
<ScriptBody><Script>'============================================================================================================
' Script Name: CM12ClientActiveMPCandidateProbe.vbs
' DATE: 08/08/2013
' Version: 1.0
' COMMENT: - Script to retrieve the active management point candidate for the ConfigMgr 2012 client
' - Used in a 2-state monitor
'============================================================================================================
option explicit
dim strComputer, objWMIService, col, item
dim iCount, strActiveMPs
dim oArgs, oAPI, oBag
Set oArgs = WScript.Arguments
if oArgs.Count < 1 Then
Wscript.Quit -1
End If
strComputer = oArgs(0)
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\ccm\LocationServices")
Set col = objWMIService.ExecQuery _
("Select * from SMS_ActiveMPCandidate")
iCount = col.Count
For Each item in col
If strActiveMPs = "" Then
strActiveMPs = item.MP
Else
strActiveMPs = strActiveMPs & vbcrlf & item.MP
End If
Next