简体   繁体   English

Import-PFXCertificate:指定的网络密码不正确

[英]Import-PFXCertificate: The specified network password is not correct

I've got some pretty simple code I'm trying to troubleshoot. 我有一些非常简单的代码正在尝试进行故障排除。 The environment is an Azure Windows Server 2012 machine, and I'm logged in as a domain admin running a Powershell console with Administrator privileges. 该环境是一台Azure Windows Server 2012计算机,我以运行域管理员身份以具有管理员权限的域管理员身份登录。

I'm just trying to Import-PFXCertificate from a known location but it will not accept the network password. 我只是想从已知位置导入Import-PFXCertificate,但它不接受网络密码。

Here's the code. 这是代码。

$SecurePWD = ConvertTo-SecureString -String 'iW@nt2die' -AsPlainText -Force
Import-PFXCertificate -Password $SecurePWD -CertStoreLocation "Cert:\LocalMachine\Root" -FilePath "C:\Certs\TestCert.pfx"

When I run this beautiful block of code, with the password being absolutely correct (I tested by logging in using the password), it greets me with this error: 当我运行这段漂亮的代码块时,密码是绝对正确的(我通过使用密码登录进行了测试),它向我打招呼:

Import-PFXCertificate : The specified network password is not correct.

WHYYYY. WHYYYY。

I've tried escaping out the @, but that doesn't do anything. 我尝试转义@,但这没有任何作用。 I've tried crying, but the computer is completely unmoved by my tears. 我曾尝试过哭泣,但眼泪完全不动计算机。

Per documentation for Import-PfxCertificate , the -Password parameter is for the password of the certificate and not the user to login with. 根据Import-PfxCertificate的文档, -Password参数用于证书的密码,而不是用于登录的用户。

-Password - Specifies the password for the imported PFX file in the form of a secure string. -Password-以安全字符串的形式指定导入的PFX文件的密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM