Power Shell to restart BizTalk Host instances

Power Shell to restart BizTalk Host instances

Recently there was a chance to implement the Power Shell script which re-start the BizTalk host instances.

————————————————————-

[ARRAY]$hostInstances = get-wmiobject MSBTS_HostInstance -namespace ‘rootMicrosoftBizTalkServer’ -Filter ‘(HostType = 1)’

write-host (‘Total Number of Host Instance : ‘+$hostInstances.Count) -Fore Yellow
Write-Host “Re-starting Host instance” -Fore Yellow

foreach ($hostInstance in $hostInstances)
{
$hostInstance.Stop()
$hostInstance.Start()
}

Write-Host “Host instances are restarted successfully” -Fore Yellow

———————————————————-

Advertisements

PowerShell script to keep BizTalk Application up and running

PowerShell script to keep BizTalk Application up and running

Recently there was a chance to implement the Power Shell script which will monitor the BizTalk application . It is very simple script which get executed by windows task scheduler at predefined time period. It will start all artifacts of BizTalk which will in stop/disable/unlisted state. If the artifacts are up and running, it will not do anything.

#BizTalk Application Monitoring
$Date = Get-Date
$Logfile = "C:ScriptLogs$(gc env:computername)_$(get-date -f yyyy-MM-dd).log"
Function LogWrite
{
   Param ([string]$logstring)
   Add-content $Logfile -value $logstring
}
$test = '----------------------------------------------------------'
LogWrite  $test
$test = 'Script Started-BizTalk Monitor at '+$Date.DateTime
LogWrite  $test

 # Get local BizTalk DBName and DB Server from WMI

 $btsSettings = get-wmiobject MSBTS_GroupSetting -namespace 'rootMicrosoftBizTalkServer'

 $dbInstance = $btsSettings.MgmtDbServerName

 $dbName = $btsSettings.MgmtDbName

 # Load BizTalk ExplorerOM

 [void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")

 $BizTalkOM = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer

 $BizTalkOM.ConnectionString = "SERVER=$dbInstance;DATABASE=$dbName;Integrated Security=SSPI"

 [ARRAY]$apps=$BizTalkOM.Applications
  Foreach ($app in $apps)
    {
       if ($app.Name -like 'BizTalkAppName*')
        {
         $app.Start(63)
         $BizTalkOM.SaveChanges()
     
         $test = $app.Name+ " Started"
         LogWrite  $test
       }

    }
 $test = 'Script executed sucessfully at '+$Date.DateTime
 LogWrite  $test

 $test = '----------------------------------------------------------'
 LogWrite  $test

 

Advertisements

PowerShell script to keep BizTalk Application up and running

PowerShell script to keep BizTalk Application up and running

Recently there was a chance to implement the Power Shell script which will monitor the BizTalk application . It is very simple script which get executed by windows task scheduler at predefined time period. It will start all artifacts of BizTalk which will in stop/disable/unlisted state. If the artifacts are up and running, it will not do anything.

#BizTalk Application Monitoring
$Date = Get-Date
$Logfile = "C:ScriptLogs$(gc env:computername)_$(get-date -f yyyy-MM-dd).log"
Function LogWrite
{
   Param ([string]$logstring)
   Add-content $Logfile -value $logstring
}
$test = '----------------------------------------------------------'
LogWrite  $test
$test = 'Script Started-BizTalk Monitor at '+$Date.DateTime
LogWrite  $test

 # Get local BizTalk DBName and DB Server from WMI

 $btsSettings = get-wmiobject MSBTS_GroupSetting -namespace 'rootMicrosoftBizTalkServer'

 $dbInstance = $btsSettings.MgmtDbServerName

 $dbName = $btsSettings.MgmtDbName

 # Load BizTalk ExplorerOM

 [void] [System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")

 $BizTalkOM = New-Object Microsoft.BizTalk.ExplorerOM.BtsCatalogExplorer

 $BizTalkOM.ConnectionString = "SERVER=$dbInstance;DATABASE=$dbName;Integrated Security=SSPI"

 [ARRAY]$apps=$BizTalkOM.Applications
  Foreach ($app in $apps)
    {
       if ($app.Name -like 'BizTalkAppName*')
        {
         $app.Start(63)
         $BizTalkOM.SaveChanges()
     
         $test = $app.Name+ " Started"
         LogWrite  $test
       }

    }
 $test = 'Script executed sucessfully at '+$Date.DateTime
 LogWrite  $test

 $test = '----------------------------------------------------------'
 LogWrite  $test

 

Advertisements

BizTalk ESB Management Portal deployment steps in Multi-Server Environment

BizTalk ESB Management Portal deployment steps in Multi-Server Environment

Recently I got a chance to install and configure the ESB Tool Kit and ESB Management portal in multi-server environment.

Below are the steps which I followed to successfully configure and deploy the ESB Management portal.

  1. Install Enterprise Library 5 from http://www.microsoft.com/en-in/download/details.aspx?id=15104
  2. Install Chart Control from Microsoft Chart Controls for .Net Framework 4 & Framework 3.5
  3. Install Microsoft Report Viewer Redistributable 2008 from http://www.microsoft.com/en-in/download/confirmation.aspx?id=6576
  4. Copy the ESB portal source code from the development server in C:Projects folder and Remove the read-only attribute of this folder.
  5. Update database server name in the web config file of ESB portal (located in “C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalESB.PortalWeb.Config” )
  6. Update Database server name in web config of ESB Exception Service (Located in “C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalESB.Exceptions.ServiceESB.Exceptions.ServiceWeb.config”)
  7. To turn on unrestricted access for Power Shell, execute the following command using the Power Shell 32-bit and 64-bit consoles:
  1. set-executionpolicy unrestricted
    1. To verify, run the following command
      1. get-executionpolicy
    2. Note: If you face any issue with above script, use “Set-ExecutionPolicy Unrestricted -Scope CurrentUser”
  1. Go to the C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalInstallScripts location and edit Management_Install.ps1 script.
  2. Comment the [BuildManagementSolution] function of Power Shell script. (This is required because there is no need to build the solution again).
  3. Update the [RunDatabaseScript $relativePath”SQLESB.Administration Database.sql” “Database server Name“] command. (This is required because It will try to create the database in local server)
  4. Step 10 is only required for first server configuration. Later comment this line of script for other server (This is because SQL Server will be same for Both BizTalk instance)
  5. Open a command prompt using “Run as administrator”.
  1. Execute the Management_Install.cmd  command located in “C:ProjectsMicrosoft.Practices.ESBSourceSamplesManagementPortalInstallScripts”.
  2. Open the IIS manager, Select the ESB portal and check the authorization. If all fine, Browse the ESB portal directly from here.
  3. If some error occurred, Change the authorization and app pool setting by checking user access.

Repeat the same step to other server.

Note: Multi-Server Environment – (Two BizTalk Server and one SQL server)

Please let me know If any suggestion on this or Feel free to add some point.

Advertisements

BizTalk ESB Management Portal deployment steps in Multi-Server Environment

BizTalk ESB Management Portal deployment steps in Multi-Server Environment

Recently I got a chance to install and configure the ESB Tool Kit and ESB Management portal in multi-server environment.

Below are the steps which I followed to successfully configure and deploy the ESB Management portal.

  1. Install Enterprise Library 5 from http://www.microsoft.com/en-in/download/details.aspx?id=15104
  2. Install Chart Control from Microsoft Chart Controls for .Net Framework 4 & Framework 3.5
  3. Install Microsoft Report Viewer Redistributable 2008 from http://www.microsoft.com/en-in/download/confirmation.aspx?id=6576
  4. Copy the ESB portal source code from the development server in C:Projects folder and Remove the read-only attribute of this folder.
  5. Update database server name in the web config file of ESB portal (located in “C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalESB.PortalWeb.Config” )
  6. Update Database server name in web config of ESB Exception Service (Located in “C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalESB.Exceptions.ServiceESB.Exceptions.ServiceWeb.config”)
  7. To turn on unrestricted access for Power Shell, execute the following command using the Power Shell 32-bit and 64-bit consoles:
  1. set-executionpolicy unrestricted
    1. To verify, run the following command
      1. get-executionpolicy
    2. Note: If you face any issue with above script, use “Set-ExecutionPolicy Unrestricted -Scope CurrentUser”
  1. Go to the C:ProjectsMicrosoft.Practices.ESBESBSourceSourceSamplesManagement PortalInstallScripts location and edit Management_Install.ps1 script.
  2. Comment the [BuildManagementSolution] function of Power Shell script. (This is required because there is no need to build the solution again).
  3. Update the [RunDatabaseScript $relativePath”SQLESB.Administration Database.sql” “Database server Name“] command. (This is required because It will try to create the database in local server)
  4. Step 10 is only required for first server configuration. Later comment this line of script for other server (This is because SQL Server will be same for Both BizTalk instance)
  5. Open a command prompt using “Run as administrator”.
  1. Execute the Management_Install.cmd  command located in “C:ProjectsMicrosoft.Practices.ESBSourceSamplesManagementPortalInstallScripts”.
  2. Open the IIS manager, Select the ESB portal and check the authorization. If all fine, Browse the ESB portal directly from here.
  3. If some error occurred, Change the authorization and app pool setting by checking user access.

Repeat the same step to other server.

Note: Multi-Server Environment – (Two BizTalk Server and one SQL server)

Please let me know If any suggestion on this or Feel free to add some point.

Advertisements