【发布时间】:2018-11-07 12:55:17
【问题描述】:
我们正在尝试以编程方式将新 SSL 证书和新绑定添加到 IIS 上的站点。我们使用 powershell 脚本来实现这一点,并且它可以与服务器上的本地管理员用户一起正常工作。问题是,我们不能让 Web 服务器上的本地管理员用户在生产环境中运行此应用程序。这将违反公司政策。 我想知道我的用户需要能够执行此操作的最低权限。这两个命令是我现在被阻止的地方。
## Does nothing but no error. Works fine if I use my admin user.
Import-PfxCertificate -FilePath $path cert:\localMachine\WebHosting\ -Password $mypwd -Exportable
## Give me : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
$newbinding = Get-WebBinding -Name $site -IPAddress $ip -Port 443 -Protocol "HTTPS" -HostHeader $hostheader
$newbinding.AddSslCertificate("$thumbprint", "WebHosting")
我很难找到需要哪些权限/配置的明确答案。我在Cant add bindings to IIS programatically - redirection.config permissions (with a video!) 之前遇到了同样的问题。现在它仍然不起作用,但不是同样的错误。
谢谢
【问题讨论】:
-
搜索 IIS REST API。
标签: windows powershell ssl iis