ConfigMgr.2012.Client.Library.Check.Active.MP.Candidate.Probe (ProbeActionModuleType)

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
PassThru ProbeAction System.PassThroughProbe Default
Script ProbeAction Microsoft.Windows.ScriptPropertyBagProbe Default

Overrideable Parameters:

IDParameterTypeSelector
TimeoutSecondsint$Config/TimeoutSeconds$

Source Code:

<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 &lt; 1 Then
Wscript.Quit -1
End If
strComputer = oArgs(0)

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &amp; strComputer &amp; "\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 &amp; vbcrlf &amp; item.MP
End If
Next

'submit property bag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
oBag.AddValue "MPCount", iCount
oBag.AddValue "ActiveMPCandidate", strActiveMPs
oAPI.Return(oBag)</Script></ScriptBody>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ProbeAction ID="PassThru" TypeID="System!System.PassThroughProbe"/>
</MemberModules>
<Composition>
<Node ID="Script">
<Node ID="PassThru"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<TriggerOnly>true</TriggerOnly>
</ProbeActionModuleType>