PowerShell provider for BizTalk (version 1.0.0)

6 January 2009

In an earlier post I wrote about the PowerShell provider for BizTalk that I’ve been working on in the past months. I’m very proud to release the very first version now. Please note that this is still a very, very, very early ‘alpha’ release. In other words it is full of bugs and not as feature rich as I wanted it to be at this time ;-) .

The PowerShell Provider for BizTalk lets you browse BizTalk as a file system. The primary goal for writing this provider is to aid me in my day to day BizTalk development work. With this in mind the first thing I wanted to be able to do is stop, start and restart host instances in an easy manner. I also wanted to replace my host manager tool with something with more flexibility. You can read more on host instances and PowerShell here.

Download link can be found here

Some features:

- Browseable BizTalk Adminstration Console like hierarchy and structure of artifacts. Read more here

- Tab completion saves you from a lot of typing

- Custom cmdlets aimed at BizTalk.

Installation instructions:

prerequisites: PowerShell 1.0 installed, BizTalk Server 2006 R2 (haven’t tried R1 yet) installed and configured.

steps:

1. run ‘PowerShell.BizTalk.msi’ and follow instructions.

2. Start a new PowerShell shell.

3. Type the command:

Add-PSSnapin PowerShell.BizTalk

4. Optionally verify that the snap-in is loaded by executing the command:

Get-PSSnapin

You should see the snap-in in the list of loaded snap-ins (see example below).

image

5. Add a connection to the local BizTalk installation by executing the command:

New-PSDrive LocalBTS BizTalk LocalBTS: -scope global -server <ServerName> -database <DatabaseName>

Replace <ServerName> and <DatabaseName> with the name of the server and database with the name of the management database.

For example:  New-PSDrive LocalBTS BizTalk LocalBTS: -scope global -server BizTalk01 -database BizTalkMgmtDb

This will create a new PowerShell drive object pointing to the BizTalk management databases.

 

Automatically load the snap-in:

Step 3,4 & 5 need to be executed every time you start a new PowerShell and want to use the BizTalk provider. To prevent you from typing the commands every time you can of course create a personal profile script. This will be loaded every time a new PowerShell shell is started. In order to do this:

1. Create a new folder in your ‘My Documents’ folder. Name this folder ‘WindowsPowerShell’.

2. Create a new text file in the folder created in step 1. Name the file ‘Microsoft.PowerShell_profile.ps1′.

3. Set the contents of the text file like below and save it.

image

When opening a new shell the snap-in should be loaded automatically.

 

Supported artifacts:

Compared to BizTalk Adminstration Console this release of the provider has a limited set of artifacts that are browseable. Also each artifact has less properties than you’re used to in the console.

artifact artifact supported in v1.0.0
Applications browse (limited properties), create, delete
Orchestrations browse (limited properties)
Role Links -
Send Port Groups -
Send Ports browse (limited properties)
Receive Ports browse (limited properties)
Receive Locations browse (limited properties)
Policies -
Schemas -
Maps -
Pipelines -
Resources -
BAS Artifacts -
Parties -
Hosts browse (limited properties)
Host Instances browse (limited properties), custom cmdlets to stop, start and restart.
Servers -
Message Boxes -
Adapters -

Limitations in this version:

- The provider makes heavily use of ExplorerOM model. As far as I know this is only supported on 32 bit platforms. So be aware when using the provider on a 64 bit platform.

- The provider does not (yet) (fully) support connections to remote BizTalk installations. Some things like e.g. browse applications work, while other browse host instances will not work.

- Make sure you have enough rights (BizTalk administrator) before using the provider. It does not check role membership or authorizations before executing code so insufficient rights may lead to nasty errors.

- Many other……

Please send me an e-mail or post a comment if you have questions, remarks, bugs, etc…


BizTalk 2009 and Health and Activity Tracking (HAT)

10 December 2008

The text below is based on the beta release of BizTalk 2009. It might not (completely) apply to the RTM release.

In BizTalk Server 2009 it looks like Microsoft has continued to move functionality from the Health and Activity (HAT) tool to the BizTalk Administration Console (MMC).

When we went from BTS2K4 to BTS2k6 we saw that some of the tasks we did with HAT (and other tools) on 2k4 now could be done with MMC on 2k6.

The biggest improvement for me personally was the inclusion of the subscription viewer function in the MMC. I still have nightmares about the user interface of the 2k4 subscription viewer tool :-) .

In BizTalk Server 2009 Microsoft took it a step further and removed the HAT tool. This means the remaining functionality is now also included in MMC.

To be more precise the HAT is not completely removed you only don’t need to start it as a separate tool anymore. If you for example use things like ‘Message flow’ or the ‘Orchestration debugger’ you’ll still get a HAT style window. Also the task manager shows a process called ‘BTSHatApp.exe’ which I think I saw somewhere before :-) . Of course I also couldn’t resist typing ‘BTSHatApp.exe’ from the start prompt, but that results in the following error message:

image

Anyway I think it is a good thing because we now really have one tool (or at least one entrance point) to do everything. I also never liked the HAT user interface very much.

There are (or were) basically three functions/queries that I use in HAT:

  • Most recent 100 service instances
  • Messages sent in the past day
  • Messages received in the past day

The query expression pane in the 2k9 MMC now has values for ‘Tracked Message Events’ and ‘Tracked Service Instances’. This will allow me to do the same thing in MMC that I previously had to do in HAT.

Screen shot 1 shows the ‘Most recent 100 service instances’ in the 2k9 way. Screen shot 2 shows the ‘Messages received in the past day’.

image

Screen shot 1: Most recent 100 service instances.

image

Screen shot 2: Most recent 100 send messages.


Powershell provider for BizTalk

13 October 2008

During the last months I’ve become a big fan of Powershell. It is a great shell which allows you to do things in a very flexible manner. When it comes to BizTalk administration tasks however most of the time you end up writing scripts that use WMI to do things.

I would be great if BizTalk developers or administrators:

  • just could walk through the biztalk artifacts in the same way we do with file folders.
  • have a (rich) set of powershell cmdlets aimed at BizTalk.

In other words we need a: Powershell provider for BizTalk. Searching the internet resulted in nothing. I found one initiative but that did not seem to have started and there were also no downloadable bits.

Anyway I decided to code a BizTalk provider myself. I have copied the artifact hierarchy tree used in the BizTalk Administration Console as much as possible (see screenshots below). The provider also supports tab completion which makes it very easy to navigate through the BizTalk artifacts.

The screenshot below contains an example of a BizTalk cmdlet to stop a specific host.

Although I’ve been very, very busy with this in the last couple of weeks there is still a lot of work to be done. So why am I telling you about this when there are no downloadable bits yet. There are two reasons:

  • I hope there are BizTalkers out there that use Powershell and want to test my provider eventually. (If so drop a comment or e-mail).
  • I want to make a list of first release cmdlets that should be included. (Suggestions? Let me know!)

BizTalk Host Manager (nothing new :-()

7 August 2008

In 2005 I wrote a small tool called BizTalk Host Manager. This tool lets you quickly restart a host instance from the system tray. It is useful in scenarios where you have do to a lot of host restarts like developing (GAC newly build BTS assembly and restart host), debugging or performance testing.

Although it was written for BizTalk Server 2004 (.Net v1.1) it also works for BizTalk Server 2006 R1 and R2.

Apparently some people still use it because now and than I receive questions from people asking where it can be downloaded. Because I am not sure if it is still available from the old location, I’ll put it on my skydrive here.

I’m currently working on a new version of the tool. I hope to have it finished soon.


Follow

Get every new post delivered to your Inbox.