This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Reflection.Assembly]::loadwithPartialName("Microsoft.BizTalk.ExplorerOM") | |
## - Force 32-bit mode, BizTalk.ExplorerOM does NOT support 64-bit mode | |
if ($env:Processor_Architecture -ne "x86") | |
{ | |
write-warning "Running x86 PowerShell..." | |
if ($myInvocation.Line) | |
{ | |
&"$env:WINDIR\syswow64\windowspowershell\v1.0\powershell.exe" -NonInteractive -NoProfile $myInvocation.Line | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer | |
$Catalog.ConnectionString = "SERVER=xxxxx;DATABASE=BizTalkMgmtDb;Integrated Security=SSPI" | |
foreach($port in $catalog.SendPorts) | |
{ | |
$portname = $port.name | |
$portapplication = $port.application.name | |
$portstatus = $port.status | |
Write-Host "Name: $portname App: $portapplication Status: $portstatus" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($port in $catalog.ReceivePorts) | |
{ | |
foreach ($location in $port.ReceiveLocations) | |
{ | |
$rxlocation = $port.ReceiveLocations | |
$locationname = $location.name | |
$locationapplication = $port.application.name | |
$locationstatus = $location.Enable | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($application in $catalog.Applications) | |
{ | |
foreach ($orchestration in $application.Orchestrations) | |
{ | |
$AppName = $application.Name | |
$OrchName = $orchestration.FullName | |
$OrchApp = $orchestration.Application | |
$OrchHost = $orchestration.Host | |
$OrchStatus = $orchestration.Status | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hostInstances = get-wmiobject MSBTS_HostInstance -namespace 'root\MicrosoftBizTalkServer' | where {$_.runningserver -match $yourBTServerName} | |
foreach ($hostInstance in $hostInstances) | |
{ | |
$hostInstanceName = $hostInstance.hostname | |
$hostInstanceServer = $hostInstance.RunningServer | |
#Checks the host instance state | |
switch ($HostInstance.ServiceState) | |
{ | |
1 {$state = "Stopped"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SqlQuery =` | |
"SET NOCOUNT ON | |
SET TRANSACTION ISOLATION LEVEL READ COMMITTED | |
SET deadlock_priority LOW | |
SELECT | |
nvcName AS ApplicationName, | |
uidInstanceID AS InstanceID, | |
nErrorCategory, | |
DATEADD(hh,-5,dtSuspendTimeStamp) AS DateSuspended, -- Subtract the appropriate hours for your timezone | |
nvcAdapter AS Adapter, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$SQLServer = 'yourBizTalkSQLServer' | |
$SQLDBName = 'BizTalkMsgBoxDb' | |
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection | |
$SqlConnection.ConnectionString = "Server = $SQLServer; Database = $SQLDBName; Integrated Security = True" | |
$SqlConnection.Open() | |
# Create SqlCommand object, define command text, and set the connection | |
$SqlCmd = New-Object System.Data.SqlClient.SqlCommand | |
$SqlCmd.CommandText = $SqlQuery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arrInstancesSuspended = @() | |
foreach ($Row in $DataSet1.Tables[0].Rows) | |
{ | |
$arrInstancesSuspended = $arrInstancesSuspended + (,($Row["ApplicationName"],$Row["InstanceID"])) | |
# Use format: $arrInstancesSuspended [0][0] | |
} | |
# Sort Array | |
$arrInstancesSuspended = $arrInstancesSuspended | Sort-Object @{Expression={$_[0]};Ascending=$true} | |
# Get unique apps | |
$unique_Application = $arrInstancesSuspended | foreach {$_[0]} | sort-object -unique |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
System.Xml.XmlDocument XMLOriginalDoc = new XmlDocument(); | |
System.Xml.XmlDocument XMLFinalDoc = new XmlDocument(); | |
// load an xml document with namespace to be changed. This example loads it from a file | |
XMLOriginalDoc.Load(openFileDialog1.FileName); | |
// Now load original document into new document, and modify namespace in the new document | |
XMLFinalDoc.LoadXml(XMLOriginalDoc.OuterXml.Replace(XMLOriginalDoc.DocumentElement.NamespaceURI, "http://MyNewNamespace")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-PerfCounterCategory | where {$_.Category_Name -like '*BizTalk*'} | Get-PerfCounterInstance | Get-PerfCounterCounters | Format-List Machine_Name,Category_Name,Counter_Name,Counter_Type,Counter_Help | Out-File c:\myouput.txt |
OlderNewer