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.

  • 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'

source: http://technet.microsoft.com/en-us/library/cc424952.aspx#section2b

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.