Hi,
I am trying to add a Certificate to the "Trusted Root Certification Authorities" using PowerShell, but haven't been able to accomplish it. I am using the following PowerShell snippet
$pfx = new-object System.Security.Cryptography.X509Certificates.X509Certificate2 $certPath = read-host "Certificate Path" $pfxPass = read-host "Password" -assecurestring $pfx.import($certPath,$pfxPass,"Exportable,PersistKeySet") $store = new-object System.Security.Cryptography.X509Certificates.X509Store("Trusted Root Certification Authorities","localmachine") $store.open("MaxAllowed") $store.add($pfx) $store.close()
I provide the "Certificate Path" as C:\MyCerts\mywildcardcert.pfx" and the "Password" as the private key used when creating the certificate. But after I run this snippet, it gives no errors but doesn't add the Certificate as well.
Strangely it creates another folder called "Trusted Root Certification Authority" and add the Certificate to that. This folder is different from the existing one. Why does it create on with the same name instead of adding it in the existing folder? I am puzzled. Also is there a way to remove that folder? (Screenshot below)
Admin QuikView Solution for CRM 2013