About a month ago we had a problem migrating an old BizTalk application from the development environment to the quality environment. This application signs the incoming messages, based on the certificate installed on the machine and put this signature in one record in the body of the message, all of this is executed in the received pipeline. The certificated is loaded based on the thumbprint.
When we attempted to test the application we get the following error:
“Cannot find a local machine certificate with the thumbprint: 5693ae76acfe33325bd6e1f05f38a9941892cb69 cannot be found.”
Because this was an old application and lack of documentation, our problem was in knowing what and where the certificate was installed.
Using MMC (Microsoft Management Console) we can see all the certificates installed on the machine, but we cannot search by thumbprint!!! 🙁
So I ask my friend José António Silva to show me the power of PowerShell to solve my annoying problem:
Solution 1
gci cert:\* -Recurse | ?{$_.Thumbprint -eq "5693ae76acfe33325bd6e1f05f38a9941892cb69"} | select Subject, PSPath}
The result will be something like this:
Subject PSPath
——- ——
O=”… S A “, C=PT, CN=… SA Microsoft.PowerShell.Security\Certificate::CurrentUser\R…
O=”… S A “, C=PT, CN=… SA Microsoft.PowerShell.Security\Certificate::LocalMachine\…
O=”… S A “, C=PT, CN=… SA Microsoft.PowerShell.Security\Certificate::LocalMachine\…
Solution 2
gci cert:\* -Recurse | ?{$_.Thumbprint -eq "5693ae76acfe33325bd6e1f05f38a9941892cb69"} | select PSParentPath
Where this time the result will be a little more simple:
PSParentPath
————
Microsoft.PowerShell.Security\Certificate::CurrentUser\Root
Microsoft.PowerShell.Security\Certificate::LocalMachine\My
Microsoft.PowerShell.Security\Certificate::LocalMachine\Root
So now I know where is the certificated installed, and what was the certificate that I should install in a quality environment.
Download
THESE POWERSHELL SCRIPTS ARE PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND.
You can download Check where a specific certificated is installed with PowerShell from GitHub here: