7
我需要从PowerShell脚本创建一个新的自签名IIS SSL证书作为自动安装的一部分。从powershell创建自签名iis ssl证书
这是我已经试过:
Import-Module WebAdministation
New-WebBinding -Name "Default Web Site" -IP "*" -Port 443 -Protocol https
New-SelfSignedCertificate -Subject Fluency -DnsName $computerName.$domainName -CertStoreLocation cert:\LocalMachine\My
Get-ChildItem cert:\LocalMachine\My | where { $_.Subject -match "CN\=$Computername\.$DomainName" } | select -First 1 | New-Item IIS:\SslBindings\0.0.0.0!443
结果
它说新SelfSignedCertificate不能用于该行被发现。如果我通过IIS管理器手动创建证书,其余的代码工作正常。
感谢您的帮助!
从[此帖](http://stackoverflow.com/questions/12463297/using-powershell-to-create-self-signed-certificate? rq = 1)是[指向TechNet文章的链接](http://social.technet.microsoft.com/wiki/contents/articles/16226.quick-start-guide-for-integrating-a-single-forest- on-premises-active-directory-with-windows-azure-ad.aspx),它可以帮助你。 – admdrew