PowerShell to split a large disk/log file

I had a huge 550 MB file, I wanted to split it into 55 or so files of 10 MB each. The one improvement I would make to this next time is to make the suffix a 3 digit number so when the files sort by name they would be in numerical order (currently _1 […]

PowerShell Search a Huge Disk or Log File for a String

You will likely get a memory error (System.OutOfMemoryException) if you use Get-Content to try to load a 550MB file into a string variable. We can using a System.IO.StreamRead in PowerShell to stream the data instead of doing one big massive load into memory. The script below allows you to search a huge file for a […]

BizTalk: SMTP – The transport error code was 0x80040217

The Full Error Was The message could not be sent to the SMTP server. The transport error code was 0x80040217 Solution I had to go to the BizTalk Adapters in BizTalk Admin Console, find the SMTP adapter, then configure it for the host. On the properties window, there is an “Authentication Type” which defaulted to […]

PowerShell Script to manage FTP/SFTP/OpenSSH log files

The script below began based on a script found in the OpenSSH GitHub forum. We had an OpenSSH log file that was about 550 MB in size. This made it hard to open in NotePad++ and difficult to find anything on a given date. Then we realized we have a similar issue (but not nearly […]

PowerShell to Split a Huge File into Smaller Files

Sometimes you have a huge large file. In my case, I encountered an OpenSSH log file that was 550 Megabytes. I will put some process in place so that it doesn’t grow so large. It contains four months of data with full debugging turned on. In such a large file, it is hard to find […]

PowerShell to MQSeries (WebSphereMQ)

I just found this sample in my archive, so decided to post it: <pre> # This demonstrates very basic MQ functionality (to a remote machine) using PowerShell # Neal Walters – 10/30/2013 Add-PSSnapin IBM.PowerShell.WebSphereMQ $qmconns = @() $qmconns += New-WMQQmgrConnDef -Name YOURNAME-HostName 10.1.3.200 -Channel YOURR.SvcChannel -Port 1415 $qmgrs = Get-WMQQueueManager -Connections $qmconns if ($qmgrs -eq […]

BizTalk 2016 – WCF-Custom Transport: Unrecognized attribute ‘ApplicationName’

I got the same error as the one in this blog: http://brucetank.blogspot.com/2017/10/biztalk-2016-wcf-custom-transport.html System.Configuration.ConfigurationErrorsException: Unrecognized attribute 'ApplicationName'. Note that attribute names are case-sensitive. The difference is that I got it run-time, where in the blog above, he got it at the time of importing the bindings. I was afraid that maybe the Cumulative Updates (CUs) were […]

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=1.0.0.0, 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 http://woshub.com/powershell-get-folder-sizes/ Fancy Example This starts with the Archive directory then basically runs the command above for […]