Save/Archive BizTalk Server suspended messages based on a filter using PowerShell

Published on : Feb 14, 2022

Category : BizTalk Server

Sandro

Author

No matter what you do, issues will happen at some point, and we need to deal with them. For example, on BizTalk Server, messages can get suspended for many reasons. Sometimes, we can resume these suspended messages. But, in other situations, we can’t, or no water what we do, they cannot be processed because they contain some errors that need to be fixed.

Regardless of the scenario or the reasons for this to happen, there are situations that we endup having several messages suspended on BizTalk Server. Using the out-of-the-box BizTalk Server Administration tool, we are only allowed to save one message at a time, which means that we need to go one by one and, after several clicks, save the message on the hard drive. This is a huge time-consuming operation.

To expedite these operations, we can use PowerShell. It’s true that we will need to spend a little time creating these PowerShell scripts, but the gain that we get is massive, and once made, we can use it anytime.

Based on a filter set by the operator, you can use this script,  to retrieve the body/payload of specific suspended BizTalk Server messages and save them to a specific folder.

To use this script, you need to provide two filter parameters:

  • Enter the name of a BizTalk service that caused the suspended messages
    • You may use wildcards (*) for the remainder of the name
  • Enter key part(s) of the error description for suspended messages
    • You may use wildcards (*) for the remainder of the error description

The result will be a list of messages created on our hard drive;

Credits to Christian Jakobsson that was the original creator of the first version of this script.

Note: this version has several changes from the original one.

Download

THIS POWERSHELL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download Save BizTalk Server suspended messages body/payload using filters with PowerShell from GitHub here: