You can make changes to the applicationHost.config file using the configuration editor and then select the Generate Script on the Action pane. However, only in IIS 8 will it generate the example script for PowerShell. I did this and it rendered the following
PowerShell syntax:
BoxingSurfer
2 Posts
set-webbindings :: BUG! cant set https binding
Jun 09, 2012 06:40 PM|LINK
in short, set-webbindinggs seems to have a bug whereby its not possible to use this command to modify an HTTPS binding
example:
i got a website X with the following bindings
protocol binding information
http 10.0.40.70:80:
https 10.0.40.70:443:
I use this command to update the BindingInformation property containing the http binding:
Set-WebBinding -name $x.name -BindingInformation "10.0.40.70:80:" -PropertyName BindingInformationm - Value "10.0.0.70:80:"
The result is the binding information is changed successfully, as expected
protocol binding information
http 10.0.0.70:80:
https 10.0.40.70:443:
But if i use a similar command to update the https binding
Set-WebBinding -name $x.name -BindingInformation "10.0.40.70:443:" -PropertyName BindingInformationm - Value "10.0.0.70:443:"
This command does nothing
protocol binding information
http 10.0.0.70:80:
https 10.0.40.70:443:
I have tried the alternate form of the command
Set-WebBinding -name $x.name -IPaddress "10.0.40.70" -Port 443 -PropertyName BindingInformationm - Value "10.0.0.70:443:"
This command does nothing either
Neither comman gives any error, but it seems that the set-WebBinding command is buggy and cant be used to update https bindings
i notices a few people on the internet said something similar
any chance MS you can fix this? because your powershell that cannot do something this basic, its stupid
.
Bug Set-WebBinding https
Perkinsville
109 Posts
Re: set-webbindings :: BUG! cant set https binding
Jun 13, 2012 01:42 PM|LINK
Hi,
You can make changes to the applicationHost.config file using the configuration editor and then select the Generate Script on the Action pane. However, only in IIS 8 will it generate the example script for PowerShell. I did this and it rendered the following PowerShell syntax:
Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST'
-filter "system.applicationHost/sites/site[@name='WEBSITENAME']/bindings
-name "."
-AtElement @{protocol='https',bindingsInformation='192.168.0.1:443:'}
I did not try the Set-WebBinding cmdlet, but maybe the Add-WebConfigurationProperty will work for you.
HTH, Ben