I have a certificate (
.pfx) that works fine when I import it using the GUI with (include all extended properites) checked.
If I import it without that checked, I can't use it in IIS.
If I try to import it via powershell (the end goal), I also can't use it in IIS.
When I try to use it in IIS, I get this error message:
A specified logon session does not exist. It may already have been
I've tried a few methods for importing it, this is the most recent version of my script:
$certPassword = convertto-securestring 'thecertpasswordhere' -asplaintext -force
Import-PfxCertificate $localFilePath -Password $certPassword
Does anyone have any idea how to make this work or what I can look into for more info? I've had no luck searching so far.
Verify the script is running with the appropriate credentials (i.e.
LOCAL SYSTEM, etc.).
You can also try piping the certificate (*.pfx) as follows:
Get-ChildItem -Path $localFilePath | Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString -String "thecertpasswordhere" -Force -AsPlainText