Create Host Named Site Collections in SharePoint Online Office 365 using PowerShell

We had a requirement in Office 365 to create a site collection with a friendly URL. Before we move to the solution, I would like to explain about Host-named site collections and Path-based site collections.

New to Office 365 SharePoint Online? Get Office 365 Enterprise E3 Subscription & Try out all the features

Using Windows PowerShell script we can create hosted named site collection, which has to be assigned to unique DNS name.

Eg. In SharePoint Administrator when we create a new site the host URL will behttp://portal.Test.Com/sites/TeamA.So here the host is http://portal.Test.Comwhich has same DNS record for it. But what if we had to create site collection named ashttp:/

In SharePoint Administrator, we will not find any option to create hosted named site collection and as mentioned above we can using Windows PowerShell. So this is what we called Host-named site collections.

Path-based site collections is the regular way of creating a site collection using SharePoint Administrator or Windows PowerShell.

In Path based the sitecollection URLS will be , etc.

All the site collections will have same host name and DNS name as per the web application.

Now we have a little bit of understanding about Host-named site collections and Path-based site collections.

Below Windows PowerShell script can be used to create Host-named site collections.

New-SPSite –OwnerAlias “Test\sam” –HostHeaderWebApplication –Name “Sam Site” -Template “STS#0”

Now the site is created and we need to have DNS record entry for the same. The DNS record will be pointing to the place where SharePoint farm DNS entries are being maintained.

Read some SharePoint 2013 PowerShell tutorial:

Hope this will be useful.

Check out Best Alternative to InfoPath -> Try Now


(Installation & Features)

About Sambita Rath

I have 9 years of exprience into SharePoint implementation, architecture, Administrator, development and Training.Designing Information Architecture in SharePoint 2007, 2010,2013 and Office 365.

View all posts by Sambita Rath →