to find the Biztalk Active and Dehydrated instances using powershell script RRS feed

  • General discussion

  • Hi,

    Has anyone has the power shell script to finf the number of active and dehydrated instances in Biztalk?

    Monday, October 13, 2014 7:04 AM

All replies

  • If you use the PowerShell BizTalk extension that ships with BizTalk Server 2013 + you should be able to use the following command, when standing in BizTalk:\Health and Activity\Service Instances:

    Get-ChildItem | Where-Object {$_.InstanceStatus -eq 'Dehydrated'} | measure

    For Dehydrated instances, change the parameters as needed.

    Morten la Cour

    Monday, October 13, 2014 8:17 AM
  • Hi Sujith,

    Following Powershell script would get you the count of Active and Dehydrated instances:

    $a=Get-WmiObject -Class "MSBTS_ServiceInstance" -Namespace 'root\MicrosoftBizTalkServer' | Where-Object { $_.Item -match "$Name" -and $_.Item -ne "" -and ($_.ServiceStatus -eq "1" -or $_.ServiceStatus -eq "2" -or $_.ServiceStatus -eq "8" ) } | measure

    Here ServiceStatus values for "Active" instance is 2 and “Dehydrated”instances is 8 (and 1 for "Ready to Run" which might help you since you're interested in active instance count)

    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    Monday, October 13, 2014 12:28 PM