How to Find the Site Template in SharePoint Online using PowerShell?

Requirement: Find the Site Template in SharePoint Online using PowerShell.

How to Find the Site Template in SharePoint Online?

You may have an existing site and want to know the site template used in creating the site in SharePoint Online. In this article, I’ll show you how to find the site template in SharePoint Online. E.g., You may want to know if it is a team site in SharePoint Online.

To check the site template of your site, do the following:

  1. Open your SharePoint Online site collection or subsite in the browser, Go to View >> Page Source. 
  2. In the page source, search for “webTemplateConfiguration”, and you’ll find the site template value next.
    Find Site Template in SharePoint Online

You can refer to this post to get all site template IDs Get Site Templates in SharePoint Online using PowerShell

How to Find the Site Template in SharePoint Online using PowerShell?

Use this PowerShell to get the site template of a site collection:

#Set Parameters
$TenantAdminURL = "https://crescent-admin.sharepoint.com"
$SiteURL="https://crescent.sharepoint.com/sites/marketing"

#Connect to SharePoint Online
Connect-SPOService -Url $TenantAdminURL -Credential (Get-Credential)

#Get Site Template of the Site Collection
(Get-SPOSite -Identity $SiteURL).Template

Get Site Template of a Sub-Site using PowerShell

Let’s retrieve the template of a subsite using PnP PowerShell.

#Set Parameters
$SiteURL="https://crescent.sharepoint.com/sites/marketing/us"

#Connect to Site
Connect-PnPOnline $SiteURL -Credentials (Get-Credential)  #-Interactive

#Get Template of the Web
$Web = Get-PnPWeb -Includes Configuration, WebTemplate

Write-host "Site Template: $($Web.WebTemplate)#$($Web.Configuration)"

You can also use the “SharePoint Manager” tool to get the site template of a SharePoint Online site, as in my other article: How to Get the Web Template Used in a SharePoint Site?

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

Leave a Reply

Your email address will not be published. Required fields are marked *