title: Set-SBCertificate not finding a valid certificate
body: <p>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:</p>
  
  <pre><code>$cert = Get-ChildItem Cert:\LocalMachine\Root | ?{$_.FriendlyName -eq '[CERTS FRIENDLY NAME]'}
  
  Set-SBCertificate -EncryptionCertificateThumbprint $cert.Thumbprint -FarmCertificateThumbprint $cert.Thumbprint`
  </code></pre>
  
  <p>Below is the error that i am getting:</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>List of the things I have done to troubleshoot this:</p>
  
  <ol>
  <li>Verified that the $cert actually contains a cert.</li>
  <li>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".</li>
  <li>Attempted to use 2 difference certs for Farm and Encryption.</li>
  </ol>
  
  <p>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!</p>