Tuesday, 27 August 2013

IIS Powershell : Assign an existing SSL binding to a website

IIS Powershell : Assign an existing SSL binding to a website

I already have an SSL binding created for one of my websites in IIS 7.5.
Now I'm adding another website which listens on the same IP and port (443)
but uses a different host header.
When I try to assign the binding using this powershell command:
New-WebBinding -Name $siteName -IP "*" -Port 443 -Protocol https
-HostHeader $hostHeader
OR
New-ItemProperty $sitePath -name bindings -value
@{protocol="https";bindingInformation=":443:"+$hostHeader}
I get the following error in Powershell.
SSL binding for end point 0.0.0.0:443 already exists.
+ CategoryInfo : InvalidData: (:) [New-Item], ProviderException
+ FullyQualifiedErrorId : SSL binding for end point 0.0.0.0:443
already ex
ists.,Microsoft.PowerShell.Commands.NewItemCommand
How can I get rid of this error?

No comments:

Post a Comment