I try to create a new search center (as a subsite of a subweb) with powershell When I do this, I get an error:

New-SPWeb : Provisioning did not succeed. Details: Failed to initialize some site properties for Web at Url: "hosturl/ER/FD/search" OriginalException: The value of AvailablePageLayouts contain s invalid url. All page layout urls inside the string have to be server relative. The url '~SiteCollection/_catalogs/masterpage/SearchResults.aspx' ('/ER/_catalogs/masterpage/SearchResults.aspx')is not in th e current site collection '/ER'. At MyScript.ps1:116 char:2 + New-SPWeb -Url $searchUrl -Template "SRCHCEN#0" -Language $web.Language

First I've activated the "PublishingSite" feature on the sitecollection (ALSO WITH POWERSHELL) Then I execute this function:

function CreateSearchSubsite{
    Param ([Microsoft.SharePoint.SPWeb] $web)

    WriteText " > Start creating a search subsite"
    $searchUrl = $web.Url.TrimEnd('/') + "/search"
    $exists = (Get-SPWeb $searchUrl -ErrorAction SilentlyContinue) -ne $null
        Remove-SPWeb -Identity $searchUrl -Confirm:$false
    New-SPWeb -Url $searchUrl -Template "SRCHCEN#0" -Language $web.Language
    WriteText " > End creating a search subsite"

Anybody who knows what's wrong with this?

1 Answer 1


Found the anwser... To create a enterprise search center, you also need to activate the "BaseSite" sitecollection feature. After activating this one, it all works like expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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