Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # make sure that there aren't any certs we are overwriting
  2.  
  3. Import-Module WebAdministration
  4.  
  5. Set-Location IIS:\SslBindings
  6.  
  7. $cert_count = Get-ChildItem IIS:\SslBindings\ | measure
  8.  
  9. if ($cert_count -gt 0) {
  10. exit
  11. }
  12.  
  13. New-WebBinding -Name "Default Web Site" -IP "*" -Port 443 -Protocol https
  14. $cert = New-SelfSignedCertificate -DnsName $env:COMPUTERNAME -CertStoreLocation cert:\LocalMachine\My\
  15. $cert | New-Item 0.0.0.0!443
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement