Search code examples
powershelliisbindingiis-7iis-7.5

(IIS) Adding net.tcp binding to a website using Powershell


I have a IIS 8 server I'm trying to replicate.

Get-Website

under "Bindings" I have a certain website with the following binding:

net.tcp 6202:*

How can I set this binding using Powershell on the replica?

I tried this:

Set-ItemProperty IIS:\Sites\SITENAME -Name bindings -Value 'net.tcp 6202:*' -Force

But it appears to simply does not do anything.


Solution

  • Try the following, based on another SO answer

    Set-ItemProperty IIS:\Sites\SITENAME -Name bindings -Value @{protocol="net.tcp"; bindingInformation="6202:*"} -Force