You have to assign the certifcate to a specific site.
You can retrieve the binding information of your site using the Get-WebBinding cmdlet and set the SSL Certificate using the AddSslCertificate
function:
$siteName = 'mywebsite'
$dnsName = 'www.mywebsite.ru'
# create the ssl certificate
$newCert = New-SelfSignedCertificate -DnsName $dnsName -CertStoreLocation cert:LocalMachineMy
# get the web binding of the site
$binding = Get-WebBinding -Name $siteName -Protocol "https"
# set the ssl certificate
$binding.AddSslCertificate($newCert.GetCertHashString(), "my")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…