BizTalk Server Performance Blog
The BizTalk Server Performance blog is essential reading.
.comment-link {margin-left:.6em;}
this.Log(Level.Info, "Getting default host");
HostSetting.HostSettingCollection hosts = HostSetting.GetInstances();
if (hosts.Count < 1)
throw new BuildException("No hosts found");
string hostName = "";
foreach (HostSetting host in hosts)
{
if (host.IsDefault)
{
hostName = host.Name;
break;
}
}
//get all orchestrations on the local server using WMI
Orchestration.OrchestrationCollection orchs = Orchestration.GetInstances();
//loop over all the orchestrations exposed by WMI and find the one we want to start now
foreach (Orchestration orchestration in orchs)
{
if (orchestration.Name == targetOrch)
{
this.Log(Level.Info, "Starting " + orchestration.Name);
orchestration.Enlist(hostName);
orchestration.Start(2, 2, 2);
this.Log(Level.Info, "Started " + orchestration.Name);
}
}
Query = "SELECT * FROM MSBTS_Orchestration WHERE Name =""" & OrchestrationName & """ AND AssemblyName = """ & AssemblyName & """"
Set InstSet = GetObject("Winmgmts:!root\MicrosoftBizTalkServer").ExecQuery(Query)