我一直在寻找解决此问题的解决方案,该解决方案适用于不同版本的Windows Server& IIS,但到目前为止我找不到一个合理的解决方案,我需要的是某种脚本或命令行工具,例如采用证书文件(pfx),然后使用相同的脚本或工具找到一个配置一个网站以使用此证书的方法。
答案 0 :(得分:0)
我在TechNet上找到了一个好的脚本
CertImport.vbs
Option Explicit
Dim iiscertobj, pfxfile, pfxfilepassword, InstanceName, WebFarmServers, IISServer
Set iiscertobj = WScript.CreateObject("IIS.CertObj")
pfxfile = WScript.Arguments(0)
pfxfilepassword = WScript.Arguments(1)
InstanceName = WScript.Arguments(2)
WebFarmServers = split(WScript.Arguments(3), ",")
iiscertobj.UserName = WScript.Arguments(4)
iiscertobj.UserPassword = WScript.Arguments(5)
For Each IISServer in WebFarmServers
iiscertobj.ServerName = IISServer
iiscertobj.InstanceName = InstanceName
iiscertobj.Import pfxfile, pfxfilepassword, true, true
Next