We were having some trouble with the DB2 Adapter and its host instance had to be restarted to allow the communication with DB2 Server. Following PowerShell script was created to automate the process:
Add-Type -AssemblyName ('Microsoft.BizTalk.Operations, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL') $dbServer = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\BizTalk Server\3.0\Administration' 'MgmtDBServer').MgmtDBServer $dbName = (Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\BizTalk Server\3.0\Administration' 'MgmtDBName').MgmtDBName $bo = New-Object Microsoft.BizTalk.Operations.BizTalkOperations $dbServer, $dbName $serviceInstances = $bo.GetServiceInstances() $hostInstances = Get-WmiObject MSBTS_HostInstance -namespace root\MicrosoftBizTalkServer -ErrorAction Stop foreach ($instance in $serviceInstances) { if(($instance.InstanceStatus -eq "Active") -or ( $instance.InstanceStatus -eq "Dehydrated") -and ($instance.HostName -eq "DB2Host")) { foreach ($hostInstance in $hostInstances) { if($hostInstance.hostname -eq "DB2Host") { Write-Host "Stop Hostinstance" $hostInstance.HostName $instance.HostName $hostInstance.Stop() $hostInstance.Start() Write-Host "Hostinstance" $hostInstance "Started" Send-MailMessage -To "<TEST@test.com>" -From "<support@test.com>" -Subject "DB2 Host Instance restarted" -Body " Dear All,<BR><BR> The DB2 Host instance on Production Server have been restarted. <BR><BR> Regards,<BR>BizTalk Support" -BodyAsHtml -SmtpServer "smtp.server.com" } } } }