Reputation: 51
I want to apply host header name to an existing binding of a site in IIS. So far i got this command but it creates a new binding but i want to apply the hostheader to the existing one. Below is the command:
new-webbinding -hostheader hostheadername -name sitename -protocol http
Is there any command to do this?
any help would be highly appreciated.
Upvotes: 0
Views: 3972
Reputation: 1577
You can easily construct this yourself using Set-WebBinding
.
Example:
Import-Module WebAdministration;
Set-WebBinding -Name "www.example.com" -HostHeader "original.example.com" -PropertyName "HostHeader" -Value "new.example.com"
Upvotes: 1
Reputation: 258
Did you tried using the set command
set -webbinding -hostheader hostheadername -name sitename
Upvotes: 0