码迷,mamicode.com
首页 > 移动开发 > 详细

Biztalk Stop all applications (powershell)

时间:2018-03-22 17:40:33      阅读:337      评论:0      收藏:0      [点我收藏+]

标签:Biztalk   powershell   

#=== Make sure the ExplorerOM assembly is loaded ===#

#=== Connect to the database, this script is designed to run under powerhsell as x86 since ExpolorerOM only supports 32bit. ===#
$databaseName = ‘BizTalkMgmtDb‘
$databaseServer = ‘WINDOWS-5N3ZH2K\BTSSQLSERVER‘

$Catalog = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer
$Catalog.ConnectionString = ‘SERVER=‘+$databaseServer+‘;DATABASE=‘+$databaseName+‘;Integrated Security=SSPI‘

#=== Gather all the apps and stop them ===#
$number = $Catalog.Applications.Count
write-host $number
$i = 1
foreach($app in $Catalog.Applications)
{
Write-Host "Issuing stop command for application "$i"\"$number"..."
$app.Stop([Microsoft.BizTalk.ExplorerOM.ApplicationStopOption] "StopAll")
$Catalog.SaveChanges()
$i++
}

Biztalk Stop all applications (powershell)

标签:Biztalk   powershell   

原文地址:http://blog.51cto.com/6060579/2089892

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!