I'm trying to add binding to a site through powershell. I know that I can use the following command in command prompt and get the job done.
appcmd set site /site.name: "Default Web Site" /+binding.[protocol='net.tcp' ,bindingInformation='443:*']
But I want to be able to do this in Powershell.
I get the following error message : The parameter 'bindingInformation=443:*]' must begin with a / or - (HRESULT=80070057).
I've tried adding the "-" before binding but it seems to not do anything , also I've tried doing it on the strings but it was futile. Can someone help me with this ?
t-angrui
5 Posts
Adding Bindings - Powershell
Aug 28, 2009 08:46 PM|LINK
Hello,
I'm trying to add binding to a site through powershell. I know that I can use the following command in command prompt and get the job done.
appcmd set site /site.name: "Default Web Site" /+binding.[protocol='net.tcp' ,bindingInformation='443:*']
But I want to be able to do this in Powershell.
I get the following error message : The parameter 'bindingInformation=443:*]' must begin with a / or - (HRESULT=80070057).
I've tried adding the "-" before binding but it seems to not do anything , also I've tried doing it on the strings but it was futile. Can someone help me with this ?
Other Alternatives in Powershell I have tried:
New-WebBinding -Site "Default Web Site" -Protocol net.tcp -Port 443 -hostheader "*"
However for Binding information I get : "*:443:*" rather than "443:*"
</div>Leo Tang - M...
4161 Posts
Microsoft
Re: Adding Bindings - Powershell
Sep 02, 2009 06:07 AM|LINK
Hi,
The appcmd command looks like this:
appcmd set site /site.name: "Default Web Site" /+bindings.[protocol='net.tcp',bindingInformation='443:*']
Note: There is no space in "[protocol='net.tcp',bindingInformation='443:*']"
As an alternative in Powershell, you can try:
New-ItemProperty IIS:\Sites\"Default Web Site" –name bindings –value @{protocol="net.tcp";bindingInformation="443:*"}
Feedback to us
Develop and promote your apps in Windows Store
steve schofi...
5681 Posts
MVP
Moderator
Re: Adding Bindings - Powershell
Sep 05, 2009 01:04 AM|LINK
You see this?
http://learn.iis.net/page.aspx/491/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in/
Steve Schofield
Windows Server MVP - IIS
http://iislogs.com/steveschofield
http://www.IISLogs.com
Log archival solution
Install, Configure, Forget
wesinhouston
1 Post
Re: Adding Bindings - Powershell
Feb 12, 2010 05:19 PM|LINK
In powershell you have to quote the parameter:
./appcmd set site /site.name: "Default Web Site" /+"bindings.[protocol='net.tcp',bindingInformation='443:*']"
I had to do this even if there where no spaces in the command. Also, it's "bindings" with an S. Not "binding".
http://forums.iis.net/t/1153161.aspx