WMS Publishing Point allow connection toggle (script)

Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect (WriteActionModuleType)

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.CommandOutput

Member Modules:

ID Module Type TypeId RunAs 
Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect.Script WriteAction System.CommandExecuter Default

Source Code:

<WriteActionModuleType ID="Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect" Accessibility="Internal" Batching="false">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ParamListSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element name="Arguments" type="xsd:string"/>
<xsd:element name="SecureInput" minOccurs="0" maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="256"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<WriteAction ID="Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect.Script" TypeID="System!System.CommandExecuter">
<ApplicationName>%windir%\system32\cscript.exe</ApplicationName>
<WorkingDirectory/>
<CommandLine>/nologo "Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect.vbs" $Config/Arguments$</CommandLine>
<SecureInput>$Config/SecureInput$</SecureInput>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
<RequireOutput>true</RequireOutput>
<Files>
<File>
<Name>Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect.vbs</Name>
<Contents><Script><![CDATA['*************************************************************************
' Script Name - Custom.Windows.WMS.Publishing.Point.AllowClientsToConnect.vbs
'
' Purpose - Toggles the status of a Windows Media Services Publishing Points'
' AllowClientsToConnect property
'
'
'
' Assumptions - based on WMS V9 SDK documentation
' works for publishing points of type broadcast and on demand
'
' Parameters 1 - PP Name (string)
' 2 - AllowClientsToConnect (boolean)
'
' Date - 28.09.2007 Raphael Burri / [email protected]
'*************************************************************************
Option Explicit

Dim objArgs, objWMSrv, objPubPoints, objPubPoint
Dim iPP
Dim strPPName
Dim bPPSetting

'get the parameters from the management pack
Set objArgs = WScript.Arguments
If objArgs.Count < 2 Then
WScript.Quit -1
End If
strPPName = objArgs(0)
bPPSetting = CBool(objArgs(1))


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 Then
objPubPoint.AllowClientsToConnect = bPPSetting
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.AllowClientsToConnect.Script"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.CommandOutput</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>