Hi Guys, today we are going to disuses about how to add the binding to IIS using Powershell. In most case, during the deployments, the one of the painful activity is adding binding for new sites. So this below posts will help those members to one step towards of Automation.

The New-WebBinding cmdlet adds a new binding to an existing website.

Explanation:

The New-WebBinding cmdlet adds a new binding to an existing website.

New-WebBinding -Name $web -IPAddress “*” -Port 80 -protocol http -HostHeader $Website -sslflags 0

-Name The name of the Web site on which the new binding is created.
-IPAddress The IP address of the new binding.
-Port The port used for the binding.
-Protocol The protocol to be used for the Web binding (usually HTTP, HTTPS, or FTP).
-HostHeader The host header of the new binding.
-SslFlags Indicates what type of certificate OR certificate storage the new website supports. Only the below values are valid:

0 (Regular certificate in Windows certificate storage),
1 (SNI certificate),
2 (central certificate store),
3 (SNI certificate in central certificate store).

 

 

What do you think?

I hope you have idea of how to add the binding to IIS using Powershell Script. I would like to have feedback from my posts readers. Your valuable feedback, question, or comments about this article are always welcome.