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

Requirement: Find Site Template in SharePoint Online using PowerShell.

How to Find the Site Template in SharePoint Online?
To determine the site template of your site,
  • Open your SharePoint Online site collection or subsite in the browser, Go to View >> Page Source. 
  • In the page source, search for "webTemplateConfiguration", and you'll find the site template value next.
    Find Site Template in SharePoint Online

How to Find the Site Template in SharePoint Online using PowerShell?
Use this PowerShell to get 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 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)  #-UseWebLogin

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

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

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

You can also use "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?
How to Find the Site Template in SharePoint Online using PowerShell? How to Find the Site Template in SharePoint Online using PowerShell? Reviewed by Salaudeen Rajack on April 13, 2019 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.