Filtering Windows Application EventLog with PowerShell

Here some PowerShell samples to get you going quickly with the Event Log. I’ve seen EventLogs that are full of noisy and bothersome INFO level messages. For example, we are seeing these “noise” messages about every 10 seconds. So scrolling through the Event Viewer looking for errors can take some time. Obviously, I’m working with […]

CSV Flat File – Send Pipeline Error: Object reference not set to an instance of an object

What I did to cause the error Dropped an XML file that went through a Map, and was picked up by a Send Port with a CSV Pipeline. Worked okay if I used PassThru Pipeline. Suspend Erorr There was a failure executing the send pipeline: “DL.MGLocationData.Pipelines.MyAppNameLocationDataCSV_Send, DL.MGLocationData.Pipelines, Version=, Culture=neutral, PublicKeyToken=59a32f7375d7234a” Source: “Flat file assembler” Send […]

Powershell to get total disk space used per directory

With BizTalk, we often archive files in a disk directory, where each Vendor has its own archive. Simple Example I found the simple example below, then expanded upon: <pre> Get-ChildItem E:\Archive | Measure-Object -Property Length -sum </pre> Source from Fancy Example This starts with the Archive directory then basically runs the command above for […]

BizTalk File Dripper (PowerShell Script)

Scenario Let’s say you have a directory with a 100 files, and you want to slowly drop those file into BizTalk (via a file adapter Receive Location). Rather than copying all the files at once, you would like to wait 2, 5, or 10 seconds between each file drop? Maybe you want to make the […]

Dealing with DB2 “Decimal Dates” in Microsoft-Land

In the system I’m working with the dates in DB2 are defined as type “DECIMAL”, the they are stored as offsets from 19000000. Note, it’s not the number of days since 1900-00-00, but literally the the current date (YYYYMMDD less 19000000). T-SQL converting numeric DB2 date to something more readable Thus, when using a T-SQL […]

How to remove duplicates on BizTalk Functoid Map

Here’s an example where I wanted to create a small XML file with a unique list of TerminalIDs from my application. On the left, which I had to blur out, the Looping functoid is connected to a parent record that repeats, and the other lines are connect to the source of the TerminalID. The scripting […]

PowerShell: Run SQL Update command (ExecuteNonQuery)

How to run a SQL command against a Microsoft SQL Server Database (MSSQL) from a PowerShell script. <pre> cls $datasource = "server=server\instance;database=mydb;trusted_connection=true" #if not using Integrated Security, #you might want to pass user/pass in variables or prompt for them #$connectionString = 'User Id=' + $username + ';Password=' + $password + ';' + $datasource $connectionString = […]

What does Saxon 9 HE mean in BizTalk map?

As of BizTalk 2020 and Visual Studio 2019, when you click on the map grid, you get the map properties window, on which you can select various “XSLT Transformation Engines”. BizTalk 2020 supports XSLT 3.0 via the Saxon transformation tool, which is created by Saxonica. Microsoft apparently chose the open source “Home Edition” (HE), and […]

BizTalk PowerShell to Restart Host, Run SQL, re-trigger SQL Polling

I found myself doing three boring tasks over and over again after each deploy: Restarting a BizTalk Host Instance Running a SQL command Disable/re-Enable the Receive Location for SQL Polling. I could potentially add a build/deploy step at the top, to combine that as well… maybe one of these days soon… To force the SQL […]