Installing the Powershell Extension for BizTalk Administration

I’ve been working in the past weeks to setup a completely new BizTalk 2016 environments for a client, and I found myself in a situation where I will need to create the hosts, host instances and adapter for all environments (DEV, TEST, UAT, PROD). These tasks are very time consuming and having to do it over and over for four times will be really boring.

To help me with this tasks, I did a quick search on the internet and I found an article written by Sandro Pereira at https://blog.sandro-pereira.com/2017/07/27/powershell-biztalk-host-instances-adapter-handlers-best-practices/ that explains how to do exactly what I wanted.

Most of the work was done by him, so I just needed to adjust the scripts to my particular scenarios.

But one thing that is missing in that paper is how to install and configure the powershell extension, so after doing some more research I found that the installation of BizTalk 2016 already contains that extension and you just need to register it in powershell to use it.

The details to do the installation are in the readme.txt file at [BizTalk Install Folder]\SDK\Utilities\PowerShell, but I’m going to describe them here as well.

Powershell Installation Steps:

  1. Open a command prompt as an administrator
  2. Change directory to the folder containing the binaries – \SDK\Utilities\PowerShell under the base install location
  3. Run the following command to install/register the dlls
  4. %windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe .\BizTalkFactory.PowerShell.Extensions.dll
  5. Open a powershell console as admin in x86 mode and set the execution policy as remote-signed:
    • Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  6. Add the PS snap-in using the usual approach as below:
    • Add-PSSnapin -Name BizTalkFactory.Powershell.Extensions

After executing these steps you will be able to execute the following cmdlets in powershell, which comes quite handy for repetitive tasks:

Add-ApplicationReference
Remove-ApplicationReference
Add-ApplicationResource
Set-DefaultApplication
Start-Application
Stop-Application
Start-HostInstance
Stop-HostInstance
Reset-HostInstance
Start-Orchestration
Stop-Orchestration
Enlist-Orchestration
Unenlist-Orchestration
Disable-ReceiveLocation
Enable-ReceiveLocation
Start-SendPort
Stop-SendPort
Enlist-SendPort
Unenlist-SendPort
Start-SendPortGroup
Stop-SendPortGroup
Enlist-SendPortGroup
Unenlist-SendPortGroup
Import-Application
Import-Bindings
Import-Policy
Get-ApplicationResourceSpec
Export-Application
Export-Bindings
Export-Policy
Deploy-Policy
Undeploy-Policy

This will help me setting my personal powershell libraries to accelerate the installation of new environments for my clients, which will save money to them and time for me.

Enjoy…

Alessandro Moura

Certified BizTalk, Mulesoft, TOGAF and Azure. Integration Specialist. Solutions Architect.

Leave a Reply

%d bloggers like this: