How to Create a Host Header Site Collection in WSS3 and SharePoint Foundation 2010

For WSS3 and MOSS you will have to open the CMD and use “stsadm” function. Here is the syntax:

stsadm -o createsite -url -owneremail -hostheaderwebapplicationurl htt://

You can also give a check at the Microsoft Technet reference:

In SharePoint Foundation 2010 you will have to use PowerShell which comes with Windows Server 2008.

First run:

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

Now lets add a new site collection with host header (be sure to configure the command accodring to your server settings – link):

New-SPSite -OwnerAlias SERVER2008\Administrator -HostHeaderWebApplication http://server2008

Sooner or later you will also like to know which Site Collections there are in you Web Application (link). You can either look for it in Central Administration but you can also run a command in PowerShell:

Get-SPWebApplication http://server2008 | Get-SPSiteAdministration -Limit ALL | Select URL

Finaly, you do not want to use your Site Collection any more. Lets delete it (link):

RemoveSPSite -Identity "" -GradualDelete