Update Host Header in IIS with Powershell

前端 未结 2 1454
忘了有多久
忘了有多久 2021-01-13 03:43

Goal: Update an existing host header for an IIS7.5 site with powershell

Problem: Set-WebBinding requires the name of t

2条回答
  •  孤街浪徒
    2021-01-13 04:35

    Give this a try:

    Get-WebBinding -HostHeader *.stuff.* | Foreach-Object{
        #$NewHeader = $_.bindingInformation -replace '\.stuff\.','.staff.'
        Set-WebConfigurationProperty -Filter $_.ItemXPath -PSPath IIS:\ -Name Bindings -Value @{protocol='http';bindingInformation=$NewHeader}
    }
    

提交回复
热议问题