Thursday, October 13, 2011

Setting the search center Url for a site collection using powershell

$web = get-spweb “url of site collection”

$web.AllProperties["SRCH_ENH_FTR_URL"] = http://searchcenter/pages

$web.Update()

Moving a SharePoint site collection as a sub-site of another site collection

Moving a site collection to be a sub-site of another site collection can be achieved by exporting the site collection data and importing it as a sub-site.

Below are the steps:

  • Open up a SharePoint 2010 Management Shell
  • Execute the following PowerShell command to export the site collection

export-spweb “site collection url” -path “export filename” -includeusersecurity –includeversions All

  • Create a sub-site at the destination location with a blank site template
  • Execute the following PowerShell command to import the site collection to the sub-site

Import-spweb “sub-site url” -path “export file name”