How to Get Site Template in SharePoint Using PowerShell?

When you create a site in SharePoint Online, you always pick a site template – for example a Team site, a Communication site, or a classic site. Later, you may want to know which template was used or see the full list of templates available in your tenant.

In this tutorial, I will show you step‑by‑step how to get SharePoint site templates using PowerShell in two ways:

  • Using the SharePoint Online Management Shell (Get‑SPOWebTemplate)
  • Using PnP PowerShell (Get‑PnPTenantSite and related commands)

We will also see how to find the template of a specific SharePoint site, and some practical tips like filtering, exporting, and understanding the template IDs.

What is a SharePoint site template?

A SharePoint site template is basically a “blueprint” for your site.
It defines things like:

  • The type of site (Team, Communication, Blog, Project site, etc.)
  • The features that are enabled
  • The layout and default pages

Each template has a Template ID such as:

  • STS#3 – Team site (no Microsoft 365 group)
  • GROUP#0 – Group‑connected team site
  • SITEPAGEPUBLISHING#0 – Communication site

Knowing these IDs is very handy when:

  • You need to audit existing sites.
  • You want to create sites via PowerShell using a specific template.
  • You are troubleshooting why some features appear on one site but not on another.

Prerequisites

Before running any script, make sure you have the right modules installed and permissions in place.

Permissions

  • You must be a SharePoint Online Administrator or Global Administrator to run tenant‑level commands such as Get-SPOWebTemplate or Get-PnPTenantSite.

You need the below two modules.

  1. SharePoint Online Management Shell

Module: Microsoft.Online.SharePoint.PowerShell

Install from an elevated PowerShell window:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell
  1. PnP PowerShell (cross‑platform, works with PowerShell 7)
Install-Module -Name PnP.PowerShell

If your organization blocks Install-Module, check with your admin or install from an internal repository.

Get Site Templates Using SharePoint Online Management Shell

The SharePoint Online Management Shell gives you a quick way to list all templates that are available in the tenant.

Step 1: Connect to your admin center

You must connect to the SharePoint Online admin center URL, which usually looks like:

https://<tenant>-admin.sharepoint.com

Example:

Connect-SPOService -Url https://szg52-admin.sharepoint.com -Credential (Get-Credential)

When prompted, enter your SharePoint admin or global admin credentials.

Example 1: Get all SharePoint Online Site Templates

Once connected, run:

Get-SPOWebTemplate

You will see output with columns like Name, Title, and sometimes Description and DisplayCategory.

NameTitle
STS#3Team site (no Microsoft 365 group)
STS#0Team site (classic experience)
BDR#0Document Center
DEV#0Developer Site
OFFILE#1Records Center
EHS#1Team Site – SharePoint Online configuration
BICenterSite#0Business Intelligence Center
SRCHCEN#0Enterprise Search Center
BLANKINTERNETCONTAINER#0Publishing Portal
ENTERWIKI#0Enterprise Wiki
PROJECTSITE#0Project Site
PRODUCTCATALOG#0Product Catalog
COMMUNITY#0Community Site
COMMUNITYPORTAL#0Community Portal
SITEPAGEPUBLISHING#0Communication site
SRCHCENTERLITE#0Basic Search Center
visprus#0Visio Process Repository

Here is an exact output you can see in the screenshot below:

power automate get current date time function

Check out Get All SharePoint Site Collections Using PowerShell

Example 2: Show Only Selected Properties

If you want a cleaner view, you can select only the columns you care about. The script to get the SharePoint site templates with selected properties:

Get-SPOWebTemplate | Select-Object Name, Title, DisplayCategory

This gives you a nice, readable table with the template ID, friendly name, and category (like Collaboration, Publishing, etc.). You can see the exact output in the screenshot below:

power automate get current date time function

Example 3: Get details for a specific template

Let’s say you only want the Team site (no Microsoft 365 group) template (STS#3).

Get-SPOWebTemplate | Where-Object { $_.Name -eq "STS#3"}| Select-Object Name, Title, Description

This is very useful when you know the template ID and want to double‑check the description before using it in scripts.

You can see the exact output in the screenshot below:

power automate get current date time function

Read Get SharePoint Site Members Using PowerShell

Example 4: Filter templates by category

Some templates are grouped under categories such as PublishingCollaboration, or Custom.

If you only want templates under the Publishing category:

Get-SPOWebTemplate |
    Where-Object { $_.DisplayCategory -eq "Publishing" } |
    Select-Object Name, Title, DisplayCategory

You can replace "Publishing" with other categories you find in your environment.

Power automate get current Month name

Tip: You can export the list to CSV for documentation using

Get-SPOWebTemplate | Select Name,Title,DisplayCategory | Export-Csv -Path "C:\Temp\SPOWebTemplates.csv" -NoTypeInformation

This is how to get all the SharePoint site templates from the SharePoint Online Management shell.

Check out Get SharePoint List Name using PowerShell

Get Site Template in SharePoint Using PnP PowerShell

PnP PowerShell gives you more flexibility and works well with PowerShell 7 on Windows, macOS, and Linux.

We’ll look at two common scenarios:

  • Get all available templates similar to your existing script.
  • Get the template for a specific site using tenant commands.

Connect to SharePoint using PnP PowerShell

For tenant‑level commands, connect to your Microsoft 365 tenant:

Connect-PnPOnline -Url https://szg52-admin.sharepoint.com -Interactive

The -Interactive parameter opens a modern sign‑in window and supports MFA, which is now the recommended approach.

If you want to connect to a specific site instead (for context‑based calls), you can connect to the site URL directly:

Connect-PnPOnline -Url https://szg52.sharepoint.com/sites/YourSite -Interactive

Example 1: Get all available SharePoint site templates using PnP PowerShell

After connecting to SharePoint Online. Follow the below script to get all the SharePoint site templates:

Get-PnPSiteTemplate

But if we run this script, the output will be in the XML, as shown below:

Power automate get current Month name

If we need to get all the SharePoint site templates in a table format through pnp, follow the script below:

Get-PnPTenantSite -Detailed | ForEach-Object {
    [PSCustomObject]@{
        Template = $_.Template
        Title = $_.Title
    }
} | Format-Table -AutoSize

After executing the above script, we will receive many SharePoint site templates, such as:

NameTitle
GLOBAL#0Global template
STS#3Team site (no Microsoft 365 group)
STS#0Team site (classic experience)
STS#1Blank Site
STS#2Document Workspace
MPS#0Basic Meeting Workspace
MPS#1Blank Meeting Workspace
MPS#2Decision Meeting Workspace
MPS#3Social Meeting Workspace
MPS#4Multipage Meeting Workspace
CENTRALADMIN#0Central Admin Site
WIKI#0Wiki Site
BLOG#0Blog
SGS#0Group Work Site
TENANTADMIN#0Tenant Admin Site
APP#0App Template
APPCATALOG#0App Catalog Site
ACCSRV#0 Access Services Site
ACCSVC#0Access Services Site Internal
ACCSVC#1Access Services Site
BDR#0Document Center
CONTENTCTR#0Content Center
TBH#0In-Place Hold Policy Center
DEV#0Developer Site
EDISC#0eDiscovery Center
EDISC#1eDiscovery Case
EXPRESS#0Express Team Site
FunSite#0SharePoint Online Tenant Fundamental Site
OFFILE#0(obsolete) Records Center
OFFILE#1 Records Center
EHS#0Express Hosted Site
EHS#2Public Publishing Portal
EHS#1Team Site – SharePoint Online configuration
OSRV#0Shared Services Administration Site
PPSMASite#0PerformancePoint
BICenterSite#0Business Intelligence Center
PWA#0Project Web App Site
PWS#0Microsoft Project Site
REVIEWCTR#0Review Center
RedirectSite#0Redirect Site
POLICYCTR#0Compliance Policy Center
SPS#0SharePoint Portal Server Site
SPSPERS#0SharePoint Portal Server Personal Space
SPSPERS#2Storage And Social SharePoint Portal Server Personal Space
SPSPERS#3Storage Only SharePoint Portal Server Personal Space
SPSPERS#4Social Only SharePoint Portal Server Personal Space
SPSPERS#5Empty SharePoint Portal Server Personal Space
SPSPERS#6Storage And Social SharePoint Portal Server Personal Space
SPSPERS#7Storage And Social SharePoint Portal Server Personal Space
SPSPERS#8Storage And Social SharePoint Portal Server Personal Space
SPSPERS#9Storage And Social SharePoint Portal Server Personal Space
SPSPERS#10Storage And Social SharePoint Portal Server Personal Space
SPSPERS#11Consumer OneDrive
SPSPERS#12JIT OneDrive Business
SPSPERS#13JIT OneDrive Consumer
SPSMSITE#0Personalization Site
SPSTOC#0 Contents area Template
SPSTOPIC#0Topic area template
SPSNEWS#0News Site
CMSPUBLISHING#0Publishing Site
BLANKINTERNET#0Publishing Site
BLANKINTERNET#1Press Releases Site
BLANKINTERNET#2Publishing Site with Workflow
SPSNHOME#0News Site
SPSSITES#0Site Directory
SPSCOMMU#0Community area template
SPSREPORTCENTER#0Report Center
SPSPORTAL#0Collaboration Portal
SRCHCEN#0 Enterprise Search Center
PROFILES#0Profiles
BLANKINTERNETCONTAINER#0Publishing Portal
SPSMSITEHOST#0My Site Host
ENTERWIKI#0Enterprise Wiki
PROJECTSITE#0Project Site
PRODUCTCATALOG#0Product Catalog
COMMUNITY#0Community Site
COMMUNITYPORTAL#0Community Portal
GROUP#0Team site
POINTPUBLISHINGHUB#0PointPublishing Hub
POINTPUBLISHINGPERSONAL#0Personal blog
POINTPUBLISHINGTOPIC#0PointPublishing Topic
SITEPAGEPUBLISHING#0Communication site
TEAMCHANNEL#0Team channel
TEAMCHANNEL#1Team channel
CSPCONTAINER#0CSP Container
SRCHCENTERLITE#0Basic Search Center
SRCHCENTERLITE#1Basic Search Center
TenantAdminSpo#0SharePoint Online TenantAdmin
TestSite#0Test Site
visprus#0Visio Process Repository
SAPWorkflowSite#0SAP Workflow Site
How to get SharePoint Site Template using the PnP PowerShell

You can use the client‑side object model via PnP to get the templates available for a specific web.

# Config variable
$SiteUrl = "https://szg52.sharepoint.com/"

# Connect to PnP Online
Connect-PnPOnline -Url $SiteUrl -Interactive

# Get context and current web
$ctx  = Get-PnPContext
$web  = Get-PnPWeb

# Get all available web templates (LCID 1033 = English)
$templates = $web.GetAvailableWebTemplates(1033, 0)
$ctx.Load($templates)
$ctx.ExecuteQuery()

# Show ID, Name, and Title
$templates | Select-Object Id, Name, Title

This returns a list of templates very similar to the one in your existing article, including IDs like GLOBAL#0STS#3GROUP#0SITEPAGEPUBLISHING#0, etc.

You can also export this list to CSV:

$templates |
    Select-Object Id, Name, Title |
    Export-Csv -Path "C:\Temp\PnpWebTemplates.csv" -NoTypeInformation

Check Add SharePoint Online List Items Using PnP PowerShell

Example 2: Get the template of all SharePoint sites in the tenant

If you want to see which template is used by each site in your tenant, you can use Get-PnPTenantSite.

Connect-PnPOnline -Url https://szg52-admin.sharepoint.com -Interactive

Get-PnPTenantSite -Detailed |
    ForEach-Object {
        [PSCustomObject]@{
            Title    = $_.Title
            Url      = $_.Url
            Template = $_.Template
        }
    } |
    Format-Table -AutoSize

This gives you a table where the Template column contains values such as GROUP#0STS#0SITEPAGEPUBLISHING#0, etc.

If you want to save this in a CSV file, you can write the below script.

Get-PnPTenantSite -Detailed |
    Select-Object Title, Url, Template |
    Export-Csv -Path "C:\Temp\TenantSitesTemplates.csv" -NoTypeInformation

Example 3: Get only team sites or communication sites

To show only classic team sites (STS#0):

Connect-PnPOnline -Url https://szg52-admin.sharepoint.com -Interactive

Get-PnPTenantSite -Template "STS#0" -Detailed |
    Select-Object Title, Url, Template |
    Format-Table -AutoSize

To show only group‑connected team sites (GROUP#0):

Get-PnPTenantSite -Template "GROUP#0" -Detailed |
    Select-Object Title, Url, Template |
    Format-Table -AutoSize

To show only communication sites (SITEPAGEPUBLISHING#0):

Get-PnPTenantSite -Template "SITEPAGEPUBLISHING#0" -Detailed |
    Select-Object Title, Url, Template |
    Format-Table -AutoSize

This is very useful when you want to know how many team sites vs communication sites you have.

Check out Delete a SharePoint Online Site Using PowerShell

Example 4: Get the template for a specific SharePoint site

If you just need the template of one SharePoint site, use -Identity; here is the complete PowerShell script:

Connect-PnPOnline -Url https://szg52-admin.sharepoint.com -Interactive

Get-PnPTenantSite `
    -Identity "https://szg52.sharepoint.com/sites/SharePointOnlineTraining" `
    -Detailed |
    Select-Object Template

After executing the above script, we will get the SharePoint site template name as shown below:

power automate date format SharePoint

You will get something like:

Template
--------
GROUP#0

GROUP#0 means this site is a modern team site connected to a Microsoft 365 Group.
If you see STS#3, that is a modern team site without a Microsoft 365 Group.

Modern vs classic templates

Here are a few common template IDs you will use very often in SharePoint.

Template IDDescription
STS#0Classic team site
STS#3Team site (no Microsoft 365 group, modern)
GROUP#0Group‑connected team site (modern)
SITEPAGEPUBLISHING#0Communication site
BLOG#0Blog site
PROJECTSITE#0Project site
COMMUNITY#0Community site

In new tenants, Microsoft recommends using GROUP#0 (team site) and SITEPAGEPUBLISHING#0 (communication site) for most scenarios.
Classic templates such as STS#0 still exist but are mainly for backward compatibility.

In this tutorial, we discussed how to get SharePoint site templates using PowerShell.

Do let me know if these examples helps you!

You may also like the following tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…