views:

27

answers:

2

I'm writing a configuration script for a BizTalk server I need to create a few adapters.

In the "BizTalk Server Administration" application this is done by going to Biztalk Server Group / Platform Settings / Adapters and choosing New / Adapter from the right-click menu.

I'd like to automate this process somehow, using a Powershell script or a SQL script. I tried to use the adm_Adapter_Create stored procedure in teh Biztalk DB but it doesn't work all the way as no send / recieve handlers get configured.

Is there any way to automate this adapter creation?

+2  A: 

You need to use WMI for this with the MSBTS_AdapterSetting class. There's some example code for this here.

tomasr
Thank you!Part of the script I wrote (if someone would need this in the future) is below
Crassy
A: 

Part of a Powershell script I wrote to solve this:

$adapterClass = [WMIClass] "root\MicrosoftBizTalkServer:MSBTS_AdapterSetting"

$adapter = $adapterclass.CreateInstance()
$adapter.Name = $adapterXml.name
$adapter.Comment = $adapterXml.comment
$adapter.Constraints = $adapterXml.constraints
$adapter.MgmtCLSID = $adapterXml.MgmtCLSID
$adapter.put() | Out-Null
Crassy