Host Headers Option?

May 19, 2011 at 12:13 PM


I don't see an option in the XML to specify the host header for the web applications. Has anyone had any experience with this?


May 20, 2011 at 12:21 AM

 In the CreateWebApp function the host Header defaults to the url without "http://" (or https://). See below for snippet of code

So , if your url is then the host header will be


If ($url -like "https://*") {$UseSSL = $true; $HostHeader = $url -replace "https://",""}       
    Else {$HostHeader = $url -replace "http://",""}


May 20, 2011 at 3:10 AM

Thanks @bes12, that's indeed correct and exactly what I was going to reply.


May 20, 2011 at 7:58 AM

great, thank you both!