Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am configuring SharePoint Server 2013 for Host-Named Site Collections & creating Initial Site Collections.

Created a new Web Application to handle Host-Named Site Collections (HNSC):

i)Created a new IIS web site: (1) Name: SharePoint HNSC Host – 80 (2) Port: 80

ii) Application Pool: (1) Created a new application pool: (2) Application Pool Name: SharePoint Default HNSC AppPool

Created a default, not template site collection at the root of the web application: a) Opened SharePoint 2013 Management Shell:

$hnscWebApp = Get-SPWebApplication | Where-Object {$_.DisplayName -eq "SharePoint HNSC Host - 80"}

New-SPSite -Name "Root HNSC Site Collection" -Url "http://????" -HostHeaderWebApplication $hnscWebApp -OwnerAlias "????\Administrator"

New-SPSite -Name "????" -Url "http://????" –HostHeaderWebApplication $hnscWebApp -Template "STS#0" -OwnerAlias "????\Administrator"

New-SPSite -Name "????" -Url "http://????" –HostHeaderWebApplication $hnscWebApp -Template "DEV#0" -OwnerAlias "????\Administrator"

But I am getting an error message "" New-SPSite: cannot find an SPWebApplication object that contains the following name""

Can someone help me to replace ???? with correct values please?

share|improve this question
I see you make the IIS web site and app pool, was this done in IIS manually or via the add web application in Central Admin? –  David Lozzi Dec 4 '12 at 17:31
I am trying to add a site collection by the SharePoint 2013 management shell. –  user1847609 Dec 12 '12 at 10:06
when you get the $hnscWebApp object, explore it, try just typing in the object name by itself. it should return the display name and the URL. –  David Lozzi Dec 12 '12 at 13:35
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


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

Browse other questions tagged or ask your own question.