How To Create An IIS Website In PowerShell With SSL Encryption

Опубликовано: 02 Октябрь 2024
на канале: TechSnips by ATA Learning
7,383
45

Train thousands of people, up your skills and get that next awesome job by joining TechSnips and becoming an IT rockstar! https://techsnips.io/join-us

Creating an IIS website in PowerShell can be done fairly easily using the New-Website command but when coupled with the requirement to allow clients to connect over HTTPS (SSL), it adds a layer of complexity to the mix.

In this snip, we'll go over how to not only create a website with the New-Website cmdlet, but explain a little about how web bindings work using the Get-WebBinding and New-WebBinding cmdlets. We'll then create a self-signed certificate using the New-SelfSignedCertificate cmdlet and finish it off by using the IIS provider to assign our newly created certificate thumbprint to the SSL binding.

Prerequisites include:
IIS10 on Windows Server 2016 (might work on 2012R2)
IIS WebAdministration PowerShell Module

Head over to adamtheautomator.com now for hundreds of in-depth, informative how-to articles just like this!