Reputation: 13
Here's my scenario: * I have a certificate installed on my server (Windows Server 2008 R2, with IIS 7.5) * I create a new HTTPS binding via PowerShell command (New-WebBinding), but I have no way here to associate this to the certificate I have (for which I do have the Thumbprint)
Any ideas on how I can go about making this association. In the attached screenshot, this can be done in the GUI simply by editing the HTTPS binding and selecting it from the drop-down, though haven't seen a good example to do this via PowerShell or Command Line.
Upvotes: 1
Views: 2309
Reputation: 59031
Use the Get-WebBinding
cmdlet to retrieve the binding of your website and set the certificate using the AddSslCertificate
method:
$httpsBinding = Get-WebBinding -Name "YourWebSiteName" -Protocol "https"
$httpsBinding.AddSslCertificate('SSL_HASH_STRING', "my")
Upvotes: 2