The script only deploys BizTalk applications. It will fail if another version of the BizTalk application has already been installed or imported, so make sure that the application is not imported in BizTalk or installed on any BizTalk server.
This script makes use of the Microsoft.BizTalk.ExplorerOM. In BizTalk 2006 R2 and BizTalk 2009 the Microsoft.BizTalk.ExplorerOM is only supported to run as a 32-bits process. So be sure to use PowerShell 32-bit!
The script consists out of three files:
1) The script itself
2) An environment configuration file
3) An installation configuration file
The script itself handles the installation logic. The environment configuration file contains all variables for a specific environment (e.g. test, production, etc.). The installation configuration file contains all the specific settings needed to deploy an application.
You will have to place the script on a BizTalk server in the BizTalk group where you want to deploy the application to. So, for example, if you have a test and production environment you will have to place the script on both environments.
Before you can use the deployment script you first have to edit the environment configuration file. The example xml-file should be pretty straightforward. There are some comments in the xml-file to explain some settings. Make sure you create the directories that are configured in the environment configuration file!
The second thing you have to do is to tell the script where it can find the environment configuration file. You will have to edit the following section in the script:
#>---------------------------------------------------------- #Input variables $EnvironmentConfigFile = "C:\scripts\Deploy\EnvironmentConfiguration.xml" #<----------------------------------------------------------
For every installation you will have to create installation configuration file. Most settings should be pretty straightforward as well, but some settings need some additional explanation. Sometimes a BizTalk application uses file directories to read and write files from. The script can create those directories. You can just add them under the tag CreateDirectories, like this:
<CreateDirectories> <CreateDirectory>C:\Temp\data\port1</CreateDirectory> <CreateDirectory>C:\Temp\data\port2</CreateDirectory> <CreateDirectory>C:\Temp\data\port3</CreateDirectory> </CreateDirectories>
If you do not need the script to create any directories just delete all the tags CreateDirectory, like this:
The script can also create event sources. You can edit the event log sources like this:
<AddEventlogSources> <AddEventlogSource> <EventlogSource>BTSName</EventlogSource> <EventlogName>Application</EventlogName> </AddEventlogSource> <AddEventlogSource> <EventlogSource>BTSName</EventlogSource> <EventlogName>Application</EventlogName> </AddEventlogSource> </AddEventlogSources>
If you do not need to create event log sources you can edit the installation configuration file like this:
After configuring everything mentioned above you are ready to start your first installation. Place all the files (MSI, binding file, installation configuration file) needed for the installation in the directory that is mentioned between the <DeliveryLocation> tags.
I hope you will find this script useful. If you have any questions, remarks or feature requests, please contact me. You can use the contact use page, twitter @jeroenhendr1ks / @bizadmblogging or LinkedIn.
If you want to run the script your executionpolicy will have to be set to unrestricted, otherwise you will get an error. You can set the executionpolicy to unrestricted by using the following command: