Dim objArgs, objWMSrv, objPubPoints, objPubPoint
Dim iPP
Dim strPPName, strAction
'get the parameters from the management pack
Set objArgs = WScript.Arguments
If objArgs.Count < 2 Then
WScript.Quit -1
End If
strPPName = objArgs(0)
strAction = LCase(objArgs(1))
If Not strAction = "start" And Not strAction = "stop" Then
WScript.Quit -1
End If
Set objWMSrv = CreateObject("WMSServer.server","localhost")
Set objPubPoints = objWMSrv.PublishingPoints
'get name for each publishing point that exists
For iPP = 0 To objPubPoints.Count - 1
Set objPubPoint = objPubPoints.Item(iPP)
If objPubPoint.Name = strPPName And objPubPoint.Type = WMS_PUBLISHING_POINT_TYPE_BROADCAST Then
Select Case strAction
Case "start"
objPubPoint.Start()
Case "stop"
objPubPoint.Stop()
End Select
Exit For
End If
Next
Set objWMSrv = Nothing
Set objPubPoints = Nothing
Set objArgs = Nothing]]></Script></Contents>
<Unicode>true</Unicode>
</File>
</Files>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="Custom.Windows.WMS.Publishing.Point.ToggleState.Script"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.CommandOutput</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>