Advertisement
tankcr

ServiceBus

Sep 3rd, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $SBFarmGatewayStatus = try {(Get-SBFarmStatus -ErrorAction SilentlyContinue) | where-object {$_.ServiceName -eq "Service Bus Gateway"}} catch{$NULL}
  2. $SBFarmMessageStatus = try {(Get-SBFarmStatus -ErrorAction SilentlyContinue) | where-object {$_.ServiceName -eq "Service Bus Message Broker"}} catch{$NULL}
  3. $FabricHostStatus = try {(Get-SBFarmStatus -ErrorAction SilentlyContinue) | where-object {$_.ServiceName -eq "FabricHostSvc"}} catch{$NULL}
  4.  
  5. $i = 0
  6. While ((($sbexists -ne $true) -and (($SBFarmStatus -eq $NULL) -or ($SBFarmGatewayStatus -eq $NULL) -or ($FabricHostStatus -eq $NULL)))-or (($i -le 3)-and ($sbexists -ne $true)))
  7. {
  8.     Write-Log -type Info "Verified that the SBFarm does not exist attempting to install SB"
  9.     $i++
  10.     $in = 0
  11.     While (($SBFarmStatus -eq $NULL) -or ($in -le 3))
  12.     {
  13.         $in++
  14.         Write-Log -type Warning "Service Bus Not Configured, attempting to Configure attempt $in"
  15.         New-SBFarm -SBFarmDBConnectionString "Data Source=SRVSPSQL;Initial Catalog=$sbcatalog;Integrated Security=True;Encrypt=False" -InternalPortRangeStart 9000 -TcpPort 9354 -MessageBrokerPort 9356 -RunAsAccount ($domain + '\srvspserviceapp') -AdminGroup 'pyrotek-cor\cor_sp_admins' -GatewayDBConnectionString "Data Source=SRVSPSQL;Initial Catalog=('SB_'+$CURENV+'_GatewayDatabase');Integrated Security=True;Encrypt=False" -CertificateAutoGenerationKey $SBCertificateAutoGenerationKey -MessageContainerDBConnectionString "Data Source=SRVSPSQL;Initial Catalog=SB_DEV_MessageContainer01;Integrated Security=True;Encrypt=False" -Verbose;
  16.         $SBFarmStatus = try {(Get-SBFarmStatus -ErrorAction SilentlyContinue)} catch{$NULL}
  17.         IF ($SBFarmStatus -ne $NULL)
  18.         {
  19.             Write-Log -type Success "Service Bus farm was successfully installed on $computername, continuing with the Workflow Intall"
  20.             MSG
  21.         }
  22.     }
  23. }
  24. $SBFarmStatus = try {(Get-SBFarmStatus -ErrorAction SilentlyContinue)} catch{$NULL}
  25. if ($SBFarmStatus -eq $NULL)
  26. {
  27.     $MyError = "Error - Service Bus Farm did Not properly deploy halting install"
  28.     MSG
  29.     Exit
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement