1

I am working on a powershell script that adds a binding in IIS using New-IISSiteBinding.

After the first run, I keep getting...

New-IISSiteBinding : Web site binding '*:443:mydomain.co.uk' already exists.
At line:7 char:1
+ New-IISSiteBinding -Name "MYSITE" -BindingInformation ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [New-IISSiteBinding], ArgumentException
    + FullyQualifiedErrorId : InvalidArgument,Microsoft.IIS.Powershell.Commands.NewIISSiteBindingCommand

When I call Get-IISSiteBinding, I can see the binding is there.

When I go to ISS, the binding isn't showing against the site.

When I go to applicationHost.config, the binding isn't in the file.

What is happening, please?

Beakie
  • 111
  • 1
  • 5
  • Here's part of some logic I use when renewing SSL certificates but in order I run: `Remove-WebBinding -Name "$SiteName" -IPAddress "*" -Port 443 -Protocol "https";` then I run SSL import logic and then follow that with `New-WebBinding -Name "$SiteName" -IPAddress "*" -Port 443 -Protocol "https";` and then I run other logic and restart IIS. In case any of that helps you, I wanted to share but will be happy to turn into an answer if you tell me. So use `New-WebBinding` instead perhaps and restart your app pool or IIS to see if it then take effect. I think IIS isn't seeing the changes PS makes. – Vomit IT - Chunky Mess Style Jul 25 '20 at 13:01
  • 1
    I'll check it out and let you know. Thanks for this. – Beakie Jul 25 '20 at 13:11

1 Answers1

1

Do you run an exchange server ? if you are not then try port 444 - with certificate binding .

443 is default SSL so ,I think that the reason you get that message .

  • The issue only started when I ran New-IISSiteBinding. If I remove it using Remove-IISSiteBinding, the issue goes away, until I run it again. Without doubt, the binding has been created by my script. – Beakie Jul 16 '20 at 08:52