Get a list of web templates and IDs in a SharePoint site


# Find the template name of SharePoint site using PowerShell
$web = Get-SPweb http://SiteUrl
Web Template:” $web.WebTemplate ” | Web Template ID:” $web.WebTemplateId

# To get a list of all web templates, use the following PowerShell code

function Get-SPWebTemplateWithId
     $templates = Get-SPWebTemplate | Sort-Object "Name"
     $templates | ForEach-Object {
    $templateValues = @{
     "Title" = $_.Title
     "Name" = $_.Name
     "ID" = $_.ID
     "Custom" = $_.Custom
     "LocaleId" = $_.LocaleId

New-Object PSObject -Property $templateValues | Select @("Name","Title","LocaleId","Custom","ID")

Get-SPWebTemplateWithId | Format-Table

Below is a list of the web templates and their IDs


Hope this helps.

Comments (8)
  1. Very handy.  Thanks for publishing.

  2. Thanks for sharing!

  3. Crtl+Z says:

    thanks for this usefull info. please allow me to share it on my blog (

  4. BlueSky2010 says:

    Thanks Praveeen – very useful!

  5. Jose Quinto says:

    Hi, Thanks for share.
    You can use also this: Get-SPWebTemplate | Select Name, Title, ID | Sort ID

  6. Jose Quinto says:

    This script is useful to obtain all Site Definitions in SharePoint. Do you know the code to obtain also Web Templates (these that use WebTemplate xml)?


  7. ben med says: free bootstrap theme and twitter api.

Comments are closed.

Skip to main content