SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created web application using Powershell then created Root Site Collection via CA after that created a Host Named Site collection using Powershell. following is the script. but when I browse to the sc it shows the default iis home page (localhost).

$ap = New-SPAuthenticationProvider
$wa = New-SPWebApplication -DatabaseName $dataBaseName –ApplicationPool $appPool -ApplicationPoolAccount $appPoolAccount -Name $name -Url $url -Port 80 -HostHeader $hostHeader -AuthenticationProvider $ap

New-SPSite "" -OwnerAlias "Dev\Amdinistrator" -HostHeaderWebApplication $wa -Name "Company" –Template "BLANKINTERNET#0" -ContentDatabase $dbName
share|improve this question
up vote 2 down vote accepted

Creating web applications when targeting Host Named Site Collections SHOULD NOT have a HOST HEADER (

From the script it seems you've considered the -HostHeader $hostHeader parameter

share|improve this answer
thank you, I have now removed hostheader parameter and created a new web application and created an empty site in CA to the web application root but still it goes to same as localhost also the default iis8 page. – Medes Mar 22 '13 at 8:54
the only way to create an new site in the HNSC is Powershell, in the link provided the actual script is provided. Also, please validate you do not have another IIS Web running on port 80 (e.g. default web site)! – Marius Constantinescu - MVP Mar 22 '13 at 18:07
so, when You create a HNSC you have to have only one web application runing on port 80? it is why I get this error. thanks – Medes Mar 23 '13 at 15:06
if you have another web application running on the port 80, it will for sure conflict with sharepoint's one. – Marius Constantinescu - MVP Mar 23 '13 at 19:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.