How to Get the Site Templates ID in SharePoint using Powershell Command

Steps:
 
Open your Powershell window in your system.
Paste the below code in your powershell window.
  1. # Find the template name of SharePoint site using PowerShell  
  2. $web = Get-SPweb http://gauti.sharepoint.com  
  3. Write-host “Web Template:” $web.WebTemplate ” | Web Template ID:” $web.WebTemplateId  
  4. $web.Dispose()  
  5.  
  6. # To get a list of all web templates, use the following PowerShell code  
  7.   
  8. function Get-SPWebTemplateWithId  
  9. {  
  10.      $templates = Get-SPWebTemplate | Sort-Object "Name"  
  11.      $templates | ForEach-Object {  
  12.     $templateValues = @{  
  13.      "Title" = $_.Title  
  14.      "Name" = $_.Name  
  15.      "ID" = $_.ID  
  16.      "Custom" = $_.Custom  
  17.      "LocaleId" = $_.LocaleId  
  18.       }  
  19.   
  20. New-Object PSObject -Property $templateValues | Select @("Name","Title","LocaleId","Custom","ID")  
  21.       }  
  22. }  
  23.   
  24. Get-SPWebTemplateWithId | Format-Table 
 Run the application and see the output .
 
Hope you have enjoyed this.
Ebook Download
View all
Learn
View all