Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set-SBCertificate not finding a valid certificate

I am attempting to apply pre-generated (from Active Directory CA) certificates to our On-Premise service bus environment via powershell. Below are the scripts I am executing:

$cert = Get-ChildItem Cert:\LocalMachine\Root | ?{$_.FriendlyName -eq '[CERTS FRIENDLY NAME]'}

Set-SBCertificate -EncryptionCertificateThumbprint $cert.Thumbprint -FarmCertificateThumbprint $cert.Thumbprint`

Below is the error that i am getting:

Set-SBCertificate : Cannot validate argument on parameter 'EncryptionCertificateThumbprint'. Valid certificate with thumbprint xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx not found At line:1 char:52 + Set-SBCertificate -EncryptionCertificateThumbprint $encryptCert.Thumbprint -Farm ... + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidData: (:) [Set-SBCertificate], ParameterBindingValidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.ServiceBus.Commands.SetSBFarmCertificate

List of the things I have done to troubleshoot this:

  1. Verified that the $cert actually contains a cert.
  2. Verified that the cert actually is installed on the server by going to mmc.exe and looking into the "Certificates (Local Computer)/Trusted Root Certification Authorities/Certificates".
  3. Attempted to use 2 difference certs for Farm and Encryption.

Does anyone have any ideas on this issue? Or possibly know where the powershell module is attempting to look for the certificates at? Any assistance is much appreciated!

like image 714
user3377493 Avatar asked Jan 30 '26 09:01

user3377493


1 Answers

In order to get this command to find the certificates we had to add them to Certificates (Local Computer) under both "Trusted Root Certification Authorities" and "Personal."

like image 121
Steven T. Cramer Avatar answered Feb 03 '26 09:02

Steven T. Cramer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!