We cannot rely on documentation if they exist, to be accurate, special regarding the status of the machines present in the environment – I never found this kind of document that tells me what is installed on the machine, what are the updates (or CU) or service pack installed and so on… and regarding BizTalk Server, I do not remember another simple task like this, get or check the list of all BizTalk Cumulative Updates installed on your machine/environment, being so painful to perform!
Of course, there are some ways to check that, for example:
- you can do it manually by checking “Control Panel\Programs\Programs and Features” and then view the “Installed Updates”, however, this can be a very annoying task and sometimes time-consuming just to try to find them in that huge list because they are not organized in a category BizTalk
- you can use BizTalk MsgBoxViewer but still if you only want to check what CU is installed, or you need to analyze your entire system with this tool, or you need to uncheck all the select default queries and check only for the cumulative updates – which can also be an annoying and time-consuming task
Probably there are other ways, nevertheless, I just want a quick and very easy way, because this is a basic and very simple task, to know what is the BizTalk Cumulative Updates installed like:
This is the list of BizTalk Cumulative Update installed in this machine: BTS2013R2LAB01 - Microsoft BizTalk Server 2013 R2 CU1 - Microsoft BizTalk Server 2013 R2 CU2 - Microsoft BizTalk Server 2013 R2 CU3
This way I know that I need to install the last CU available: “Microsoft BizTalk Server 2013 R2 CU4”. Yeah!
PowerShell script overview
So how can we easily automate tasks? and reuse them whenever necessary and at the same time save significant time for other tasks?
Using PowerShell is a good option. Windows PowerShell is a Windows command-line shell designed especially for system administrators and can be used by BizTalk administrators to help them in automating repetitive tasks or tasks that are time-consuming to perform manually.
This is a simple script that allows you to configure the template name of the cumulative updates, that will change from version to version, and will give you the list of all cumulative updates installed on your machine:
$keyResults = Get-ChildItem -path HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\ -Recurse -ErrorAction SilentlyContinue | where { $_.Name -match $CUNameTemplate} foreach($keyItem in $keyResults) { if ($keyItem.GetValue("DisplayName") -like "*$CUNameTemplate*") { write-host "-" $keyItem.GetValue("DisplayName").ToString().Substring(0,$keyItem.GetValue("DisplayName").ToString().IndexOf(" CU")+4) } }
THIS SQL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
After installing the CU4 in my machine the result was what I was expecting:
This is the list of BizTalk Cumulative Update installed in this machine: BTS2013R2LAB01 - Microsoft BizTalk Server 2013 R2 CU1 - Microsoft BizTalk Server 2013 R2 CU2 - Microsoft BizTalk Server 2013 R2 CU3 - Microsoft BizTalk Server 2013 R2 CU4
Download
THIS POWERSHELL IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download Check all BizTalk 2013 R2 Cumulative Updates installed in server with PowerShell from GitHub here:
Thanks for sharing useful script