|
Home > Archive > BizTalk Server Administration > June 2005 > Creating Dynamic Send Port in a script
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Creating Dynamic Send Port in a script
|
|
| Craig Neuwirt 2005-06-13, 5:51 pm |
| Are there any scripts out there (WMI, ...) that can create and configure a
Dynamic Send Port?
thanks,
craig
| |
| Yossi Dahan 2005-06-29, 5:51 pm |
| Craig
I've quickly made the script at the end of this post for you, its a modified
version of a script from the help file.
it uses WMI although you could use the ExplorerOM object model to do the
same. this is a good starting point, but obviously you'd have to take it
from here.
let me know if you need anything else
Yossi Dahan
Option Explicit
' wbemChangeFlagEnum Setting
const UpdateOnly = 1
const CreateOnly = 2
CreateDynamicSendPort
Sub CreateDynamicSendPort()
Dim objLocator, objService, objSendPort, objSP
' Connects to local server WMI Provider BizTalk namespace
Set objLocator = Createobject ("wbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer(".",
"root/MicrosoftBizTalkServer")
' Get WMI class MSBTS_SendPort
Set objSendPort = objService.Get ("MSBTS_SendPort")
Set objSP = objSendPort.SpawnInstance_
objSP.Name = "WMIDynaimcSendPort"
objSP.IsDynamic = true
objSP.IsTwoWay=false
objSP.SendPipeline = "Microsoft.BizTalk.DefaultPipelines.PassThruTransmit,
Microsoft.BizTalk.DefaultPipelines, Version=3.0.1.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"
' Create instance
objSP.Put_(CreateOnly)
CheckWMIError
End Sub
'This subroutine deals with all errors using the WbemScripting object. Error
descriptions
'are returned to the user by printing to the console.
Sub CheckWMIError()
If Err <> 0 Then
On Error Resume Next
Dim strErrDesc: strErrDesc = Err.Description
Dim ErrNum: ErrNum = Err.Number
Dim WMIError : Set WMIError = CreateObject("WbemScripting.SwbemLastError")
If ( TypeName(WMIError) = "Empty" ) Then
wscript.echo strErrDesc & " (HRESULT: " & Hex(ErrNum) & ")."
Else
wscript.echo WMIError.Description & "(HRESULT: " & Hex(ErrNum) & ")."
Set WMIError = nothing
End If
wscript.quit 0
End If
End Sub
"Craig Neuwirt" <cneuwirt@emsinet.com> wrote in message
news:uRczjyDcFHA.2756@tk2msftngp13.phx.gbl...
> Are there any scripts out there (WMI, ...) that can create and configure a
> Dynamic Send Port?
>
> thanks,
> craig
>
>
|
|
|
|
|