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

How to create default site collection if After sharepoint installation sharepoint default site collection does not exist using powershell script. I need this because at time of activation of extenal content type feature, business data model if default site collection does not exist than in Bussiness Connectivity Service i am not able to find my external type model.

So plz guide my how can i check default site collection exist or not using powershell script.

share|improve this question
Is this for SharePoint 2010 or 2013? – TempaC Nov 8 '13 at 13:33

For SharePoint 2013 I found the following PowerShell code in an article about Host-named Site Collections. I think the PowerShell code is the same for SharePoint 2010:

Creating a root site collection

A root site collection is a requirement for any Web application. It is also necessary for crawling content. This site collection must have the same URL as the Web application. Currently, SharePoint prevents the creation of a host-named site collection with the same URL as a Web application. Therefore, the root site collection is created as a path-based site collection.

New-SPSite 'http://<servername>' -Name 'Portal' -Description 'Portal on root' -OwnerAlias 'contoso\administrator' -language 1033 -Template 'STS#0'


share|improve this answer
How to check root site is created or not using powershell? – user1337886 Nov 9 '13 at 6:28

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.