$Thumbprint = (Get-ChildItem -Path Cert:\LocalMachine\My | Where-Object {$_.Subject -match "CN=appserver.domain.com"}).Thumbprint;
$guid = [guid]::NewGuid()
$certHash = $thumbprint
$ip = "0.0.0.0" # This means all IP addresses
$port = "8280" # the default HTTPS port
"http add sslcert ipport=$($ip):$port certhash=$Thumbprint appid={$guid}" | netsh
我是通过在线搜索得到的,但它不起作用。我运行它时不会创建该条目。我正在检查netsh http show sslcert
并且没有任何内容。
答案 0 :(得分:2)
如果您有PowerShell 4.0+,则可以使用Add-NetIPHttpsCertBinding
文档+示例https://technet.microsoft.com/itpro/powershell/windows/networktransition/add-netiphttpscertbinding