Being in The Netherland for the first time and provably inspired by the cold outside my hotel room, that discourages any "reasonable person" to walk in streets of Arnhem at night, let’s talk about another familiar problem that can occur in BizTalk Server. The error that I will address today is quite normal to appear when we are trying to apply Cumulative Updates (CU), and is probably transversal to all versions, in our BizTalk environment. I got it recently while I was trying to apply BizTalk Server 2013 R2 CU1:

Failed to stop service WINMGMT

Failed-to-stop-service-WINMGMT

Be aware that for example BizTalk Server Administration console relies on Windows Management Instrumentation (WMI); more specifically, the BizTalk WMI Provider (BTSWMIProvider.dll).

WMI runs as a service with the display name "Windows Management Instrumentation" and the service name "winmgmt". WMI runs automatically at system startup under the LocalSystem account. If WMI is not running, it automatically starts when the first management application or script requests connection to a WMI namespace.

CAUSES

I actually don’t know the reasons that sometimes this problem occurs. Maybe we don’t “force” to run the setup “as an administrator” or because some of the dependent services failed to stop for some specific reason.

Normally, the CU setup will try to stop all the necessary or required services before it started to install the updates. But sometimes, to successfully install some of the cumulative updates, you should manually stop some of the following services before you start the installation:

  • Enterprise Single Sign-On (SSO) (Service Name: ENTSSO)
  • IIS Admin Service (Service Name: IISADMIN)
  • Windows Management Instrumentation (Service Name: Winmgmt)

Note: To determine whether there are any WMI processes active, use Windows Task Manager. Or, run the tasklist command from the Command Prompt and check whether "WmiPrvSE.exe" exists.

SOLUTION

You can easily solve this problem by manually stopping the Windows Management Instrumentation service (Winmgmt):

  • Click Start, click All Programs, and then click Accessories.
  • Right-click Command prompt, and then click “Run as administrator”.
    • Or, in the Start Search box, type cmd, and then press CTRL+SHIFT+ENTER.
  • At a command prompt, enter “net stop winmgmt”.

Note: if you don’t open command prompt as administrator you may end receiving an “Access is denied” message.

Failed-to-stop-service-WINMGMT-cmd

Continuing with “Errors and Warnings, Causes and Solutions”, let’s talk today about a classic (and annoying) one:

“Error 87 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 88 at Microsoft.BizTalk.Gac.Fusion.IAssemblyCache.InstallAssembly(AssemblyCacheInstallFlag flags, String manifestFilePath, IntPtr referenceData)

at Microsoft.BizTalk.Gac.Gac.InstallAssembly(String assemblyPathname, Boolean force)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.GacInstall(String assemblyLocation)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.PrivateDeploy(String server, String database, String assemblyPathname, String applicationName)

at Microsoft.BizTalk.Deployment.BizTalkAssembly.Deploy(Boolean redeploy, String server, String database, String assemblyPathname, String group, String applicationName, ApplicationLog log)

Error 89 Unspecified exception: "

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 90 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 91 Failed to add resource(s). Change requests failed for some resources. BizTalkAssemblyResourceManager failed to complete end type change request. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

Error 93 Assembly "<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50" references the following assemblies that must be deployed before deploying this assembly:

Assembly "<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50"

Error 94  Deploy operation failed.

""

Assembly "<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50" references the following assemblies that must be deployed before deploying this assembly:

Assembly "<name of the assembley>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6d6ddb8f4f8e0e50"”

Visual-Studio-BizTalk-Solution-Deploy-Access-denied

while trying to deploy from Visual Studio a BizTalk solution.

This is actually very common in the recent versions of BizTalk Server, special because some additional securities setting present in recent Windows Server versions.

CAUSES

There are several possible causes for you to get access denied errors when deploying BizTalk solutions directly from Visual Studio. Here are some of the most common causes that you need to take in consideration and check for:

  • You are not a local Administrator: make sure you have administrator rights on the BizTalk server, this is required because BizTalk assemblies needs to be deployed into GAC;
  • You don’t have the right BizTalk privileges to deploy artifacts: Make sure the user account that is trying to deploy the Visual Studio BizTalk Solution is member of:
    • BizTalk Server Administrators group
    • And also, member of SSO Administrators or SSO Affiliate Administrators group

This is required because BizTalk artifacts needs to be “registered” in BizTalk databases and these memberships should grant you the required access to the databases;

  • Visual Studio BizTalk Deployment properties are incorrect: Visual Studio use the setting present in Deployment tab of each BizTalk project present in the visual studio solution to correctly deploy the artifacts (dlls). You should verify that your deployment configurations are correct by right-clicking the project in Visual Studio, selecting “Properties” and then click the Deployment tab. The most important properties that you need to check should be “Configuration Database” and “Server”, validate if they are what you expect them to be, and you should also check the “Application Name” property. Check more about Deployment Properties here: How to Set Deployment Properties in Visual Studio;
  • You are not running Visual Studio as administrator: If you have UAC activate, or sometimes even disactivated, there are some additional securities setting present in recent Windows Server versions that, by default, doesn’t run Visual Studio with elevate permissions. Again, this is required because BizTalk assemblies needs to be deployed into GAC;
  • Some process is locking the files: in some situations, some other processes, other Visual Studios or BizTalk Host Instances, may have a lock on the file(s) you are trying to replace, in these cases, stopping or restarting these services before deploying the solution should help.
SOLUTIONS

In the causes, I already described the basic steps to solve this error based on the situation you are in, so I will not address in detail here all the possible solution. In my case, and I think that is the most common situation, was that, despite having disabled the UAC, I was running the Visual Studio without elevate permissions.

There are several ways to solve this problem (running Visual Studio with elevate permissions), the simple way of course is to:

  • On the Start screen, type Visual Studio.
  • Right-click under Visual Studio and choose “Run as administrator” option.

Visual-Studio-run-as-administrator-Access-denied

The problem of this approach is that I need to remember myself to do it whenever I want to run Visual Studio, otherwise, the next time it will fail again with the same error.

To resolve once and for all, you can opt for two approaches:

  • Option one:
    • Access to the devenv.exe file on the file system, for example: “C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE”
    • Right-click devenv.exe and select "Troubleshoot compatibility".

Visual-Studio-Troubleshoot-compatibility

    • On the “Select troubleshooting option” page, select "Troubleshoot compatibility" option.

Visual-Studio-Troubleshoot-compatibility-option

    • On the “What problems do you notice?” page, select the "The program requires additional permissions" option and then click “Next”

Visual-Studio-Troubleshoot-compatibility-problem-notice

    • On the “Test compatibility settings for the progem” page, click "Test the program…", wait for the program to launch and then click "Next".
    • Select "Yes, save these settings for this program"
    • and then click "Close"
  • Option two:
    • Right click the Visual Studio icon and select “Properties” option
    • On the Visual Studio … Properties windows select the “Shortcut” tab and then click “Advanced…” button
    • On the “Advanced Properties” window, check “Run as administrator” option and then click “OK”

Visual-Studio-run-as-administrator-advance-properties

    • Back to the Visual Studio … Properties windows, click “OK”

Today I’m returning to one of my favorites topics … no not transformations, this time is all about “Errors and Warnings, Causes and Solutions”.

Today I encountered the following issue when I was trying to connect to a remove SQL Server database:

“The local MS DTC detected that the MS DTC on <server name> has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running ‘msdtc -uninstall’ and then ‘msdtc -install’ from the command prompt will fix the problem. Note: Running ‘msdtc -uninstall’ will result in the system losing all MS DTC configuration information.”

MSDTC-has-the-same-unique-identity

CAUSE

The error message is quite lucid about the main reason of this error, this normally occurs when the machines are cloned: “systems be cloned using supported cloning tools such as SYSPREP.

SOLUTION

This is one of those very few cases that the error message will give us the actually cause of the problem and the solution: “Running ‘msdtc -uninstall’ and then ‘msdtc -install’ from the command prompt will fix the problem.”

So, to solve this problem you need to:

  • Click Start, and then click Command Prompt.
  • At the command prompt, type “msdtc -uninstall”, and then press ENTER.
  • At the command prompt, type “msdtc -install”, and then press ENTER.

Note: To perform this procedure, you must have membership in Administrators, or you must have been delegated the appropriate authority.

However, after I resolve this condition by uninstalling and then reinstalling the Microsoft Distributed Transaction Coordinator service (MSDTC), when I access the BizTalk Administration Console and try to refresh (F5) the Group Hub Page I got this additional error:

“The Microsoft Distributed Transaction Coordinator (MSDTC) may not be configured correctly. Ensure that the MSDTC service is running and DTC network access is allowed on the BizTalk, SQL and SSO Master servers. For more information, see "MSDTC Configuration settings required for BizTalk Server" in the BizTalk Server Help.”

MSDTC-may-not-be-configured-correctly

I try to restart the MSDTC service or other services like the Enterprise Single Sign-On Service without any success… to avoid spending more time around this issue, and because this was a DEV standalone machine, I decided to restart the server… and that did the trick, after the restart everything was working without any problem.

Microsoft announced on October 27, 2016 the release of Microsoft BizTalk Server 2016 – the 10th major release of BizTalk Server –and, as usual with previous versions, I updated my installation and configuration manual for BizTalk Server 2016. This whitepaper will explain in detail – a step-by-step guideline – how to install and configure Microsoft BizTalk Server 2016 on a standalone environment running Windows Server 2016. This information will help you plan the installation and configuration of BizTalk Server 2016, applications and components on which it depends focused on creating a development environment (you can also follow this tutorial to help you create production environments, however if this is the case you need to skip some steps).

BizTalk-Server-Installation-scenario

Assumptions and out of scope

It will be assumed that the operating system: Windows Server 2016 and latest critical Windows updates from Microsoft already have been installed.

In this scenario, it will be performed a full installation of Microsoft BizTalk Server 2016, with the exception of the deprecated SharePoint Adapter (SharePoint Services Service Side Object Model (SSOM)). The following components will be installed:

  • Enterprise Single Sign-On (SSO).
  • BizTalk Group.
  • BizTalk Runtime.
  • Business Rule Engine.
  • BAM Tools and Alerts.
  • BAM Portal.
  • BizTalk EDI/AS2 Runtime
  • Microsoft BizTalk Adapters for Enterprise Applications (BizTalk Adapter Pack)
What’s in store for you?

By reading this whitepaper, you will understand:

  • Important considerations before setting up BizTalk Server 2016
  • Prerequisites for installing BizTalk Server 2016
  • Step by step process of installing BizTalk Server 2016 on Windows Server 2016
  • Best ways in which you can optimize your BizTalk Server 2016 environment
  • Hardware and Software requirements
  • Basic Configuration vs. Custom Configuration

Installing-Configure-BizTalk-Server-2016-Standalone-Machine

Contents
  • BizTalk Server Installation scenario
    • Assumptions and out of scope
  • Important considerations before set up the server.
    • Join the Local Administrators Group.
    • Change the Machine name.
    • Turn off Internet Explorer Enhanced Security Configuration (optional)
    • Disable User Account Control (optional).
    • Turn Windows Firewall off (optional).
    • Configure the Application Event Log.
    • Configure Microsoft Distributed Transaction Coordinator (MS DTC).
    • Customize Taskbar and Start Menu Properties (optional).
    • Set the default browser.
    • Install Critical Windows Updates.
  • Preparing and install prerequisites for BizTalk Server 2016.
    • Important considerations before set up the servers.
    • Enable Internet Information Services.
      • Running the BAM Portal in a 64-bit Environment.
    • Install Windows Identity Foundation (WIF) (optional).
    • Install and configure SMTP Server Feature (optional)
      • Verify Your Installation
    • Install Microsoft Office Excel 2016 (optional).
      • Installing and configuring Office 2016 Deployment Tool
      • Installing Microsoft Office Excel 2016
    • Install Visual Studio 2015 (optional).
      • Remove Microsoft SQL Server Express.
    • Install SQL Server 2016.
    • Configure SQL Server Database Mail feature.
  • Install and configure BizTalk Server 2016.
    • Install BizTalk Server 2016.
      • Verify Your Installation.
    • Configure BizTalk Server.
      • Pin BizTalk Server Administration to taskbar.
    • Configure SQL Server Network Configuration protocols.
    • Validate Mail account used by BizTalk to send BAM Alerts.
    • Install BizTalk Adapter Pack
      • Microsoft BizTalk Adapter Pack and Microsoft BizTalk Adapter Pack (x64).
      • Steps to install BizTalk Adapter Pack.
      • Add adapters to BizTalk Administration Console.
    • Install Critical Windows Updates and BizTalk Server Cumulative Update Package.
    • Configure BizTalk Server SQL Jobs.
      • How to configure Backup BizTalk Server (BizTalkMgmtDb).
      • How to configure DTA Purge and Archive (BizTalkDTADb).
      • MessageBox_Message_Cleanup_BizTalkMsgBoxDb.
  • Optimize the BizTalk Server 2016 environment
    • Deleting BizTalk backup files.
      • Implementing a custom sp_DeleteBackupHistory.
      • Implementing a Maintenance Plan to clean BizTalk Database backup’s files.
    • Pre-allocate space and define auto-growth settings for BizTalk Server databases.
    • Configure BizTalk Server Windows Services.
    • Install and configure BizTalk Health Monitor.
      • How to register BizTalk Health Monitor Snap-In.
      • How to integrate BHM Snap-In into BizTalk Admin Console
    • Configure BizTalk Jobs History (Microsoft SQL Server Agent job history log).
      • To resize the job history log based on raw size.
    • Managing and cleaning BizTalk Server MarkLog database tables.
    • Configure host and Host instances.
      • What’s is Host, Host Instances and Adapter Handlers?.
      • Best practices to Configuring Hosts and Host Instances.
      • How can I automate this task?.
    • Power Mode.
    • Consider setting the ‘text in row’ table option to boost BizTalk Server Performance
      • How to exploit the Text in Row table option in BizTalk Server
  • Appendix A: Hardware and Software Requirements
  • Appendix B: Redistributable CAB Files
  • Appendix C: Basic Configuration vs. Custom Configuration

 

Download the whitepaper for free here: Installing BizTalk Server 2016 in a Standalone Machine

Installing-Configure-BizTalk-Server-2016-Standalone-Machine-vertical

If you are interest to see other version check the following posts:

 

I would like to take this opportunity also to say thanks to Lex Hegt for reviewing this whitepaper.

Download the whitepaper for free here: Installing BizTalk Server 2016 in a Standalone Machine

I just updated three of my useful BizTalk PowerShell scripts in some cases fixing some small bugs, improving performance and in other cases adding also new capabilities.

PowerShell to configure Default Dynamic Send Port Handlers for each Adapter: This is a simple script that allows you to configure the default send handlers associated with all the existing Dynamic Send ports in your environment

  • In this new release I fixed some small bugs in the code that were not allowing the script to work as expected.

Check more about the script here: BizTalk DevOps: How to configure Default Dynamic Send Port Handlers with PowerShell

The full script can be found and download on Microsoft TechNet Gallery:
PowerShell to configure Default Dynamic Send Port Handlers for each Adapter (3.0 KB)
Microsoft TechNet Gallery

 

PowerShell to Configure the Default Send Handler for each static Send Port: This is a simple script that allows you to configure the Send handler associated with all the existing Static Send Ports in your environment independently of the adapter that is configured.

  • In this new release I fixed some small inconsistencies in the code, nevertheless in this case the previous script was working fine.

Check more about the script here: BizTalk DevOps: Configure the Default Send Handler as the Send Handler for each existing static Send Ports with PowerShell

The full script can be found and download on Microsoft TechNet Gallery:
PowerShell to Configure the Default Send Handler for each static Send Port (3.0 KB)
Microsoft TechNet Gallery

 

Monitoring BizTalk Server Ports with Auto-Healing capabilities with PowerShell: This is a simple script that allows you to monitor your BizTalk environment for disabled receive locations and stopped or unenlisted send ports, and automatically resume then according to certain conditions, using PowerShell.

In this new release:

  • I improved the general performance of the script
  • And add a new feature to the script: the ability to save a copy of the monitor report in the hard drive or a shared folder.

Check more about the script here: BizTalk DevOps: Monitor your BizTalk environment using PowerShell –Monitoring Ports (Stopped/disabled/unelisted) with Auto-Healing capabilities

The script can be found and download on Microsoft TechNet Gallery:
Monitoring BizTalk Server Ports with Auto-Healing capabilities with PowerShell (14.0 KB)
Microsoft TechNet Gallery

 

So, why these script are important?

All of these task can be easily made manually but they are time consuming tasks, special the monitor task if you don’t have the proper monitor tools like BizTalk360 or other tools available in the market. These PowerShell scripts allows you to automate and streamline these tasks saving us a considerable amount of time.

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

Instead of trying to archive everything I want at once, what will probably take me long time, I decided to publish another version of my Microsoft Integration Stencils Pack with an additional of 80 new shapes and some reorganization. With these new additions, this package now contains an astounding total of ~911 shapes (symbols/icons) that will help you visually represent Integration architectures (On-premise, Cloud or Hybrid scenarios) and solutions diagrams in Visio 2016/2013. It will provide symbols/icons to visually represent features, systems, processes and architectures that use BizTalk Server, Microsoft Azure and related technologies.

  • BizTalk Server
  • Microsoft Azure
    • BizTalk Services
    • Azure App Service (API Apps, Web Apps, Mobile Apps, PowerApps and Logic Apps)
    • Microsoft Flow
    • Event Hubs
    • Service Bus
    • API Management, IoT and Docker
    • Machine Learning, Stream Analytics, Data Factory, Data Pipelines
    • and so on
  • PowerBI
  • PowerShell
  • And many more…

The Microsoft Integration Stencils Pack v2.3 is composed by 8 files:

  • Microsoft Integration Stencils v2.3 (406 Shapes)
  • MIS Apps and Systems Logo Stencils v2.3 (109 shapes)
  • MIS IoT Devices Stencils v2.3 (131 shapes)
  • MIS Support Stencils v2.3 (108 shapes)
  • MIS Servers and Hardware v2.3 (45 shapes)
  • MIS Originals v2.3 (42 shapes)
  • MIS Users v2.3 (40 shapes)
  • MIS Devices v2.3 (30 shapes)

If you are wonder where is v2.2? yes I skipped one version, version 2.2 was a private version Smile.

These are some of the new shapes you can find in this new version:

Microsoft-Integration-Stencils-Pack-v2.3-new-shapes

You can download Microsoft Integration Stencils Pack for Visio 2016/2013 from:

Microsoft Integration Stencils Pack for Visio 2016/2013 (7,7 MB)
Microsoft | TechNet Gallery

Exciting news… Version 1.9.1.0 of BizTalk Mapper Extensions UtilityPack for BizTalk Server 2013 R2 and 2013 is now available!

Here’s the change-log for this release:

  • Updated Logical Functoids:
    • The project has sign strong name key solving an issue regarding to “Unable to add BizTalk.Logical.Functoids.dll to the GAC (version 1.9.0.0)” – However, this is a false problem or a BizTalk Deployment Framework that always put functoid assemblies in the GAC, because these functoids are doesn’t need to be place inside the GAC.
  • Updated CRM Functoids:
    • CRM Lookup Functoid: This functoid was updated. This functoid allows you to retrieve a value from CRM lookup field. But now this functoid is also able to performs lookup operation using two different approach: Accessing the CRM database (read-only), for local CRM integration or through the CRM web services if you want avoid giving access to the database or if you have to integrate CRM online.
The new CRM Lookup Functoid

One of the biggest changes in this new version was made by Salvatore Pellitteri that decided to change the previous CRM Lookup Functoid (also created by him) by adding additional features.

This functoid, has the previous one, allows you to retrieve a value from CRM lookup field. However, this new version of the functoid is able to performs lookup operation using two different approach:

  • Accessing the CRM database (read-only), for local CRM integration
  • Through the CRM web services if you want avoid giving access to the database or if you have to integrate CRM online.
Parameters

The functoid takes five mandatory input parameters:

  1. SSO Application Name: the connection parameters are stored inside SSO. Here you have to specify the application name where you decide to store the settings. This allow you to have multiple CRM environments that you can integrate;
  2. CRM Guid Field Name: key field name of which you want to get the value;
  3. CRM Entity Name: CRM entity name on which the resolution will be performed
  4. CRM Input Field Name: imagining having a “code” as input and you want to know the CRM physical key, in this attribute should specify the name of the “code” field.
  5. CRM Input Value: value from source system to resolve

The output of the functoid is a string, Example: 6erg5r-sdrf56-4dfgt5-6ty5r4-456trt 24

new-CRM-Lookup-Functoid-1910

Installation

Create a SSO application.

SQL Server Lookup

Create the following SSO configuration parameters:

  • CrmConnectionType: “sql”
  • CrmDatabaseConnectionString: specify the CRM database connection string

Open SQL Server management console, connect to CRM database and execute the script under CRMLookup.sql file in project folder.

Local CRM web services lookup

Create the following SSO configuration parameters:

CRM Online web services lookup

Create the following SSO configuration parameters:

You can found and download Source Code, Application Binaries and Documentation in CodePlex BizTalk Mapper Extensions UtilityPack home page:

BizTalk Mapper Extensions UtilityPack
CodePlex

 

or from MSDN Code Gallery:

BizTalk Mapper Extensions UtilityPack for BizTalk Server 2013 R2 (685.6 KB)
Microsoft | MSDN Code Gallery

We cannot rely on documentation, if they exist, to be accurate, special regarding to the status of the machines present in the environment – I never found this kind of document that tell me what is installed on the machine, what are the updates (or CU) or service pack installed and so on… and regarding to BizTalk Server I do not remember another simple task like this, get or check the list of all BizTalk Cumulative Updates installed in 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 find them in that huge list because they are not organized in a category BizTalk

BizTalk-CU1-In-RosettaNet-Category

BizTalk-CU2-and-3-In-UDDI-Category

  • you can use BizTalk MsgBoxViewer but still if you only want to check what CU are 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

Check-BizTalk-CU-with-MsgBoxViewer

Check-BizTalk-CU-with-MsgBoxViewer-result

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 are the BizTalk Cumulative Updates installed likeConfused smile

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”. Yehhh!

PowerShell script overview

So how can we easily automate tasks? and reuse them whenever necessary and at the same time saving 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 in 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 install 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

You can download the PowerShell Script used here from:

Check all BizTalk Cumulative Updates installed in server with PowerShell (2 KB)
Microsoft | TechNet Gallery

In the previous post I provide a fix to the PowerShell script to that is able to configure the Deployment Properties of a BizTalk project, keeping my word, at least half of it, because I also found the same problems in the PowerShell script to fix or configure the Signing Properties of a BizTalk Project, i.e., it only worked if the signing properties already existed in the file(s) (.btproj). This means that:

  • if we obtain a copy of the project from the source control that have already have these properties defined, it will work otherwise the script was unable to properly set these properties.
  • if we were working on a new project then definitely the script didn’t set up the signing properties.

Again, I promised that I would fix it and now I’m keeping the rest of my word. Along with the previous, this is probably one of scripts that I use the most and the reason why is…

So, why this script is important?

Again, and this is nothing new, before deploying a BizTalk project we must first strongly sigh the assemblies involved in the project to give them a unique identification for allowing them to be installed into the GAC.

GAC (Global Assembly Cache) is a machine code cache that stores assemblies that can be shared by multiple applications on the computer. This assemblies needs to be strongly signed so that they can have a unique identification in the GAC.

A strong-named assembly provides several security benefits:

  • A strong name guarantees the uniqueness of the assembly by assigning a digital signature and a unique key pair.
  • A strong name protects the lineage of the assembly by ensuring that no one else can generate a subsequent version of the assembly.
  • A strong name provides a strong integrity check to guarantee that the contents of the assembly have not changed since the last build.

In the process of deploying a BizTalk solution, Visual Studio first builds the assemblies. The deployment process requires that each assembly is strongly signed. You can strongly sign your assemblies by associating each project in the solution with a strong name assembly key file. That is an easy and rapid task (non-time consuming task). However, if a solution in Visual Studio contains multiple projects, you must separately configure properties for each project.

This seems a slight and easy task but now imagine that you have almost 200 projects inside a unique Visual Studio Solution! It will be an insane operation and the most likely to happen is you to fall asleep in front of the pc… once again.

With this PowerShell you will be able to parameterize all projects inside a Visual Studio Solution running a single line of code and avoid spending numerous hours doing this task manually.

PowerShell script overview
    $allPropertyGroup = $xml.Project.PropertyGroup
    foreach($node in $allPropertyGroup)
    {
        if($node.AssemblyOriginatorKeyFile -ne $null)
        {
            $addNewKeyNodeFlag = $false;
            $node.AssemblyOriginatorKeyFile= $keyName;
        }

        if($node.SignAssembly -ne $null)
        {
            $addNewSignNodeFlag = $false;
            $node.SignAssembly= $true;
        }
    }

    if($addNewKeyNodeFlag -eq $true)
    {
        $childItemGroup = $xml.CreateElement("PropertyGroup",$xdNS)
        $childNone = $xml.CreateElement("AssemblyOriginatorKeyFile",$xdNS)
        $childNone.AppendChild($xml.CreateTextNode($keyName));
        $childItemGroup.AppendChild($childNone)
        $xml.Project.InsertBefore($childItemGroup, $xml.Project.ItemGroup[0])
    }

    if($addNewSignNodeFlag -eq $true)
    {
        $childItemGroup = $xml.CreateElement("PropertyGroup",$xdNS)
        $childNone = $xml.CreateElement("SignAssembly",$xdNS)
        $childNone.AppendChild($xml.CreateTextNode($true));
        $childItemGroup.AppendChild($childNone)
        $xml.Project.InsertBefore($childItemGroup, $xml.Project.ItemGroup[0])
    }

    $allItemGroup = $xml.Project.ItemGroup.None;
    foreach($node in $allItemGroup)
    {
        if($node.Include -eq $keyName)
        {
            $addKeyToSolutionFlag = $false;
        }
    }

    if($addKeyToSolutionFlag -eq $true)
    {
        $childItemGroup = $xml.CreateElement("ItemGroup",$xdNS)
        $childNone = $xml.CreateElement("None",$xdNS)
        $childNone.SetAttribute("Include", $keyName)
        $childItemGroup.AppendChild($childNone)
        $xml.Project.InsertBefore($childItemGroup, $xml.Project.Import[0])
    }
THIS SQL SCRIPT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.

You can download the PowerShell Script used here from:

BizTalk Server: Fixing BizTalk Project Signing Properties with PowerShell (2 KB)
Microsoft | TechNet Gallery