Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
8.7k views
in SharePoint Server by 39 45 53
How to get the SharePoint site template name and ID that used for SharePoint site in SharePoint 2016 and SharePoint 2019 using PowerShell?

Also, I need to get the list of all SharePoint site templates.

Thanks

1 Answer

1 like 0 dislike
by 158 184 367
selected by
 
Best answer

Get SharePoint Site Template Name using PowerShell

To check which site template is used for a specific site, try the following:

  • Open SharePoint Shell as Administrator.
  • Run the below cmdlet with your SharePoint site URL.

     (Get-SPWeb http://debug.to/melqassas).WebTemplate
    

Get SharePoint Site Template Name for each web site in Site Collection using PowerShell

To check which site template is used each site in site collection, try the following:

  • Open Windows PowerShell as Administrator.
  • Run the below cmdlet with your SharePoint site collection URL.

     Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop    
     $site = get-spsite http://epm:19812
        foreach ($web in $site.AllWebs)
           {
              $web | select URl, WebTemplate , WebTemplateID
           }
    

    Get SharePoint Site Template Name for each web site in Site Collection PowerShell

Get All list of SharePoint Site Template Name and Title using PowerShell

To get the list of all SharePoint Templates, try the following:

  • Open Windows PowerShell as Administrator.
  • Run the below cmdlet with your SharePoint site collection URL.

      Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction Stop    
      Get-SPWebTemplate
    

    get the list of all SharePoint Templates PowerShell

This cmdlet may take some time


You might also like to read

by 39 45 53
0 0
Very helpful, thank you!
If you don’t ask, the answer is always NO!
...