10

I have inherited SharePoint 2010 farm that was previously upgraded from MOSS2007. I am wanting to document the setup and would like to document which site templates were used to create the various site collections and sub-sites in the farm.

How can I determine which site template was used to create a particular site?

7

By using Powershell:

add-pssnapin "Microsoft.SharePoint.PowerShell"

$s = get-spsite "http://localhost"

#this will resolve the name
$name = $s.RootWeb.WebTemplate

#this will resolve the id
$id = $s.RootWeb.Configuration

#this will give you the template for the specified language
$template = $s.RootWeb.GetAvailableWebTemplates(1033)[$name + "#" + $id]
  • This works in 2013 too – Tom Resing Dec 30 '12 at 21:04
  • +1 $s.RootWeb.WebTemplate is good enough for some lazy people :) It returns a code-like description of the template name. For example "SRCHCENTERLITE" as string instead of template object with Title "Basic Search Center" – Mzn May 14 '14 at 8:51
1

The SharePoint 2007 Pre-Upgrade checker should have informed you which templates were in use in the environment, you could refer back to the report generated by that tool to see which where used.

0

Determine site type

$web = Get-SPWeb "http://server/sites/legal/sitename" $templateID = $web.WebTemplateId.ToString() Write-Host $templateID

Your Answer

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