Team blog of MCS @ Middle East and Africa

This blog is created by Microsoft MEA HQ near shoring team, and it aims to share knowledge with the IT community.With its infrastructure and development sides,It brings to you the proven best practices and real world experiences from Subject Matter Experts
Follow Us On Twitter! Subscribe To Our Blog! Contact Us

Migrating to SharePoint Host Name Site Collections 1

Migrating to SharePoint Host Name Site Collections 1

  • Comments 2
  • Likes

According to technet article , “Host-named site collections provide a scalable Web hosting solution with each site collection assigned to a unique DNS name. In a Web hosting deployment, each host-named site collection has its own vanity host name URL, such as, , or”.

Host Name Site Collection is actually a means to have a separate DNS for each site collection rather than having all the site collections follow the URL of the web application (path-based site collections). The advantages and limitations of this approach as well as an overview of Host Named site collections is present at

A sample power shell script to create a web application for Host Name Site collections as well as creating a host named site collection under it is as follows:

$webTemplate = "STS#1"

$hostHeaderWebApp = "http://<WebAppName>:<WebAppPort>"

$hostHeaderWebAppPort = <WebAppPort>

$AppPoolName = <AppPoolName>

$AppPoolAccount = <AppPoolAccount>

$firstHostNamedSiteCollection = <URL of Host Name Site Collection>

$firstHostNamedSiteCollectionContentDB = <Content Database for Site Collection>


$webApp = New-SPWebApplication -ApplicationPool $AppPoolName -ApplicationPoolAccount $AppPoolAccount -Name $AppPoolName -Port $hostHeaderWebAppPort -AuthenticationMethod NTLM

New-SPContentDatabase -Name $firstHostNamedSiteCollectionContentDB -WebApplication $hostHeaderWebApp


$SpSite = New-SPSite $firstHostNamedSiteCollection -ContentDatabase $firstHostNamedSiteCollectionContentDB -OwnerAlias <OwnerDomainAccount>  -HostHeaderWebApplication $hostHeaderWebApp -Template $webTemplate

  • It says Sharepoint is already using the web site.

    I'm using the URL of http://<servername>:80

    I inherited the farm, how do I find the offending site so I can move it?

  • Use a different IP for the Web (Post based on my work :))

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment