我有一个证书(.pfx),当我使用带有(包括所有扩展属性)的GUI导入它时,它工作得很好。如果没有检查就导入它,我就不能在IIS中使用它。如果我试图通过powershell导入它(最终目标),我也不能在IIS中使用它。
当我试图在IIS中使用它时,我会收到以下错误消息:
指定的登录会话不存在。它可能已经被终止了。
我尝试过几种导入它的方法,这是我的脚本的最新版本:
$certPassword = convertto-securestring 'thecertpasswordhere' -asplaintext -force
Import-PfxCertificate $localFilePath -Password $certPassword有没有人知道如何使这个工作,或什么我可以查看更多的信息?到目前为止我还没有找到任何线索。
谢谢!
发布于 2016-11-07 18:08:13
使用适当的凭据(即LOCAL SYSTEM等)验证脚本正在运行。
您还可以尝试将证书(*.pfx)按以下方式传递:
Get-ChildItem -Path $localFilePath | Import-PfxCertificate -CertStoreLocation Cert:\LocalMachine\My -Password (ConvertTo-SecureString -String "thecertpasswordhere" -Force -AsPlainTexthttps://stackoverflow.com/questions/37124903
复制相似问题