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
param | |
( | |
[Parameter(Position=0,Mandatory=$true, HelpMessage="Path to biztalk resource, e.g. C:\BizTalkDeploy\Maps\1.0.0.10")] | |
[string]$resourcePath, | |
[Parameter(Position=1,Mandatory=$true, HelpMessage="list of files to import, separated by a comma, e.g. (BRE.1.60.xml,BRE.1.61.xml)")] | |
[string]$resourceNames | |
) | |
# Load necessary BizTalk assemblies | |
try |
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 | Save-ConfigPerfCounter -PathConfigFile c:\myouput.xml -NewFile |
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 |
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
$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
$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
$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
$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
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
foreach($port in $catalog.ReceivePorts) | |
{ | |
foreach ($location in $port.ReceiveLocations) | |
{ | |
$rxlocation = $port.ReceiveLocations | |
$locationname = $location.name | |
$locationapplication = $port.application.name | |
$locationstatus = $location.Enable | |
} | |
} |
NewerOlder