heberoxx 发表于 2018-9-15 11:07:56

Biztalk Stop all applications (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( "StopAll")
  $Catalog.SaveChanges()
  $i++
  }

页: [1]
查看完整版本: Biztalk Stop all applications (powershell)