title: How to use Powershell to get a websites HostHeader
body: <p>I am trying to use powershell to pull hostheaders for any websites installed. Once I have that down, I want to look specifically for hostHeaders only for websites using port 80 and port 443.</p>
  
  <p>So far I was able to use the </p>
  
  <p><code>get-webbinding cmdlet</code></p>
  
  <p>to pull some information from the website, but I am unsure how to use it to query websites for the HostHeader information. In the output of the get-webbinding command I see the host headers as part of the bindingInformation column, but am unsure how to just get the host header info. </p>
  
  <p>However when I query a website via</p>
  
  <p><code>get-webbinding -HostHeader (hostHeaderName)</code></p>
  
  <p>I get information back, so I believe there is a way to use get-webbinding to query for only the hostHeader information.</p>
  
  <p>If there is another way to get this information, please let me know. I have also had no luck trying to use </p>
  
  <p><code>get-website</code></p>