在Windows Server 2008中使用PowerShell安装SSL证书

是否有可能在Windows Server 2008 R2中使用PowerShell安装SSL证书?

如果不是,可以使用cmd命令行吗?

我正在用mmc来做这件事,但是用PowerShell做这件事还是不错的。

您可以使用certutil.exe 。 确切的语法根据证书文件格式(.cer,.pfx …)而有所不同,但其中的一个选项应该能够做到这一点:

 certutil -addstore my <filename> certutil -installcert <filename> certutil -importcert <filename> certutil -importpfx <filename> 

更多信息在这里: http : //technet.microsoft.com/en-us/library/cc772898(WS.10).aspx 。


这也可以在本地的PowerShell中完成,但是要复杂得多,因为没有内置的证书pipe理命令,所以你必须使用.NET X.509库( System.Security.Cryptography.X509Certificates )。

没有时间为sf.com质量的答案,但有人请随时改善,谢谢

公钥基础设施PowerShell模块

PowerShell证书提供程序