« Previous Next »

Not Answered Thread: Set-WebBinding to change SSL port

Last post 08-04-2009 12:43 AM by sergeia. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 07-14-2009, 2:08 AM

    Set-WebBinding to change SSL port

     Hi Guys,

     I have a question that google or the iis.net forums cant seem to answer. I can't find a way to use Set-WebBinding to change the port for an SSL bindings port number.

    Bit of background. I want to switch the port numbers between a live site and a maintenance site so users can't get access while we are updating builds. Changing HTTP ports is simple, the HTTPS is a different matter:

    HTTP (working)

     Set-WebBinding -Name 'Public' -HostHeader "PUBLIC.TESTING.LOCAL" -IP "*" -Port 80 -PropertyName Port -Value 8000

    HTTPS (not working)

     Set-WebBinding -Name 'Maint' -IPAddress "*" -Port 443 -PropertyName Port -Value 4430

    I don't know if its because there is no HostHeader on the https binding, or the Set-WebBinding doesn't like the command because a cert is applied to it (i've tried to pipe a get-item 0.0.0.0!443 into the Set-WebBinding and no go), but nothing I've tried will work. Running the command in Verbose mode doesn't throw anything juicy.

    Any help is greatly appreciated!

    Matt

  • 08-04-2009, 12:43 AM In reply to

    • sergeia
    • Top 100 Contributor
    • Joined on 04-14-2008, 4:47 PM
    • Posts 68

    Re: Set-WebBinding to change SSL port

    Hi Matt!

     

    Unfortunately, it is a bug in our code for this command. Sorry about that and thanks for reporting it. We will fix it in our next refresh of IIS snapin.

    You could use low level command to set binding value for https protocol:

    set-webconfigurationproperty "/system.applicationHost/sites/site[@name='bar']/bindings/binding[@protocol='https']" -name bindingInformation -value '*:4430:'

    Here 'bar' is site name, and command will select all https bindings on this site. If you have more than one, you could add bindingInformation attribute into that XPath query: [@protocol='https' and @bindingInformation='*:443:']. Quotation marks around XPath query are important, otherwise PowerShell gets confused. Please, let me know it it will help.

     

    Thanks,

    Sergei

Page 1 of 1 (2 items)
Microsoft Communities