Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

How to Get the Site Template in SharePoint Using PowerShell (STS#3, GROUP#0 and More)

To get the site template in SharePoint using PowerShell, run Get-PnPTenantSite -Identity <site URL> and read its Template property. You’ll get an ID like GROUP#0, STS#3 or SITEPAGEPUBLISHING#0, which tells you exactly what kind of site you’re looking at.

That ID matters when you audit a tenant, script new sites or figure out why one site has features another one doesn’t.

In this tutorial, we’ll cover every get site template SharePoint PowerShell task I run on client tenants: the template of one site, the template of every site, the list of templates you can use, and what each ID actually means.

The sample sites we’ll use

I ran every PnP example in this post against my own tenant. You’ll need PnP PowerShell in PowerShell 7 and your own Entra ID app; my guide to installing PnP PowerShell for SharePoint Online walks through both.

Most commands here read tenant-wide data, so connect to the SharePoint admin center first:

$adminUrl = "https://spguides-admin.sharepoint.com"
$clientId = "00000000-0000-0000-0000-000000000000"   # your Entra ID app's client ID

Connect-PnPOnline -Url $adminUrl -ClientId $clientId -Interactive

Here are the SPGuides sites we’ll keep coming back to. Each one was created a different way, so each one reports a different template:

SPGuides sites with their template IDs GROUP#0, SITEPAGEPUBLISHING#0, STS#0 and TEAMCHANNEL#1 in PowerShell

The three GROUP#0 sites are team sites with a Microsoft 365 group. SPGuides News is a communication site, SPGuidesClassic is an old classic team site, and the last one belongs to a Teams private channel. If you’re not sure how these site types differ, read communication site vs team site first.

Method 1: Get the Template of One Site with Get-PnPTenantSite (Recommended)

This is the one I use most of the time. It reads the site collection’s properties from the admin center, so you don’t even need access to the site itself.

Here’s the command:

Get-PnPTenantSite -Identity "https://spguides.sharepoint.com/sites/SPGuides" |
    Select-Object Title, Url, Template, LocaleId, Status |
    Format-List

For the SPGuides site, it returns Template : GROUP#0, along with the language and status:

Get-PnPTenantSite and Get-PnPWeb returning the GROUP#0 site template of the SPGuides site

How does this work?

-Identity takes the site’s full URL (or its ID for modern sites). Get-PnPTenantSite then returns a SiteProperties object, and Template is just one of its properties.

GROUP#0 means the site is connected to a Microsoft 365 group. LocaleId 1033 is English (United States).

So here’s the catch: Get-PnPTenantSite works on site collections only. If you pass a subsite URL, you won’t get the subsite’s template.

Method 2: Read WebTemplate and Configuration with Get-PnPWeb

Use this one for subsites, or when you only have access to the site and not the admin center. It reads the template straight from the web. Need a refresher on subsites? See creating a subsite in SharePoint Online.

Connect-PnPOnline -Url "https://spguides.sharepoint.com/sites/SPGuides" -ClientId $clientId -Interactive

$web = Get-PnPWeb -Includes WebTemplate, Configuration
"Template ID: $($web.WebTemplate)#$($web.Configuration)"

In the bottom half of the screenshot above, Get-PnPWeb returned WebTemplate GROUP and Configuration 0. Put them together with a # and you get GROUP#0, the same answer as Method 1.

How does this work?

Every SharePoint template ID has two parts. The name before the # is the site definition (STS, GROUP, SITEPAGEPUBLISHING), and the number after it is the configuration inside that definition.

That’s why STS#0, STS#1 and STS#3 are all STS sites but behave very differently.

-Includes matters here. Without it, WebTemplate and Configuration aren’t loaded, and you’ll see empty values.

Method 3: Get the Template of Every Site in the Tenant

To see what kinds of sites a tenant has, pull every site and group them by template. For more on listing sites, see getting all SharePoint Online sites with PnP PowerShell.

$sites = Get-PnPTenantSite
"Sites found: $($sites.Count)"

$sites | Group-Object Template |
    Sort-Object Count -Descending |
    Format-Table Count, Name -AutoSize

My tenant has 166 sites, and 115 of them are GROUP#0:

Get-PnPTenantSite grouped by Template showing the count of GROUP#0, SITEPAGEPUBLISHING#0 and STS#3 sites

How does this work?

Get-PnPTenantSite with no parameters returns every site collection except OneDrive sites. Group-Object then counts how many sites share each Template value.

The 20 RedirectSite#0 entries aren’t real sites. SharePoint leaves one at the old URL whenever a site’s address changes.

Also notice SitePagePublishing#0 in mixed case. SharePoint stores some template IDs that way, so always compare with -eq (case-insensitive) and never -ceq.

To hand this to a manager, send it to a CSV file instead:

Get-PnPTenantSite |
    Select-Object Title, Url, Template |
    Sort-Object Template |
    Export-Csv -Path "C:\Reports\site-templates.csv" -NoTypeInformation

Pro Tip: Add -Detailed to Get-PnPTenantSite only when you need properties like storage usage. It fills in every attribute but takes noticeably longer on a big tenant. My PnP PowerShell scripts for SharePoint developers include more audit reports like this one.

Method 4: Filter Sites by Template (and Include OneDrive)

If you only care about one kind of site, let SharePoint filter on the server instead of downloading everything:

# Only communication sites (server-side filter)
Get-PnPTenantSite -Template "SITEPAGEPUBLISHING#0"

# OneDrive sites are left out unless you ask for them
Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'" |
    Group-Object Template

The first command returned 20 communication sites. The second one found 15 OneDrive sites that the earlier commands never showed:

Get-PnPTenantSite filtered by the SITEPAGEPUBLISHING#0 template and OneDrive sites with SPSPERS templates

How does this work?

-Template takes any template ID and returns only matching sites.

OneDrive sites are hidden by default. -IncludeOneDriveSites brings them back, and the URL filter keeps only the personal sites. In my tenant they report two IDs, SPSPERS#10 and SPSPERS#12, so filter on both if you report on OneDrive.

Method 5: Use Get-SPOSite and Get-SPOWebTemplate (SharePoint Online Management Shell)

If your team already uses the SharePoint Online Management Shell, you don’t need PnP at all. Connect with Connect-SPOService (it opens a modern sign-in, so no -Credential is needed) and read the Template property from Get-SPOSite:

Connect-SPOService -Url "https://spguides-admin.sharepoint.com"

# Template of one site
(Get-SPOSite -Identity "https://spguides.sharepoint.com/sites/SPGuides").Template

# Template of every site (Get-SPOSite returns 200 sites unless you add -Limit ALL)
Get-SPOSite -Limit ALL | Group-Object Template | Sort-Object Count -Descending

# Only group-connected team sites, no OneDrive
Get-SPOSite -Template "GROUP#0" -IncludePersonalSite:$false -Limit ALL

Get-SPOSite gives the same IDs as Get-PnPTenantSite. The big gotcha is the 200-site default: without -Limit ALL, a larger tenant quietly returns a partial list.

Get-SPOWebTemplate does something different. It doesn’t tell you which template a site uses. It lists the templates you can create sites from:

# All templates in the admin center's language
Get-SPOWebTemplate | Select-Object Name, Title, DisplayCategory

# One template by name
Get-SPOWebTemplate -Name "STS#3"

# French templates
Get-SPOWebTemplate -LocaleId 1036

How does this work?

Get-SPOWebTemplate returns Name, Title and DisplayCategory for each template, in the language of your admin site unless you pass -LocaleId. You need to be at least a SharePoint administrator to run either cmdlet.

I didn’t run these two for this post (the Management Shell needs an interactive sign-in), but the syntax matches Microsoft’s current reference.

List the Templates Available for New Sites

The PnP equivalent of Get-SPOWebTemplate is Get-PnPWebTemplates. Run it when you’re about to create a site and want the right ID for creating a site with PnP PowerShell:

Get-PnPWebTemplates -LCID 1033 |
    Sort-Object DisplayCategory, Name |
    Format-Table Name, Title, DisplayCategory -AutoSize

For English (LCID 1033), my tenant returned 15 templates:

Get-PnPWebTemplates listing available SharePoint Online site templates such as STS#3 and SITEPAGEPUBLISHING#0

STS#3 and SITEPAGEPUBLISHING#0 are in the list, so you can pass them to New-PnPTenantSite. GROUP#0 and STS#1 aren’t: group sites come from New-PnPSite -Type TeamSite, which also builds the Microsoft 365 group.

SharePoint Site Template IDs Explained (STS#3, GROUP#0 and More)

Here’s what the IDs you’ll actually see in a SharePoint Online tenant mean. I’ve only included ones I found in my tenant or in Microsoft’s documentation:

Template IDWhat it isNotes
STS#3Modern team site without a Microsoft 365 groupListed as “Team site (no Microsoft 365 group)”. The usual choice for New-PnPTenantSite.
STS#0Classic team siteListed as “Team site (classic experience)”. Still available, but new sites should be modern.
STS#1Classic blank siteConfiguration 1 of STS. Not offered for new sites in SharePoint Online; older or migrated sites can still report it.
GROUP#0Team site connected to a Microsoft 365 groupCreated by Teams, Outlook groups or New-PnPSite -Type TeamSite. Reporting only.
SITEPAGEPUBLISHING#0Communication siteListed as “Communication site”. May appear as SitePagePublishing#0.
TEAMCHANNEL#0, TEAMCHANNEL#1Sites for Teams private channelsManaged by Teams; my tenant’s private channel site reports TEAMCHANNEL#1.
SPSPERS#10, SPSPERS#12OneDrive personal sitesHidden unless you use -IncludeOneDriveSites (or -IncludePersonalSite with Get-SPOSite).
APPCATALOG#0Tenant app catalog siteWhere SPFx solutions and apps are uploaded.
REDIRECTSITE#0Redirect left at an old site URLCreated when a site’s address changes. Not a real site.
SRCHCEN#0Enterprise Search CenterThe classic /search site.
SPSMSITEHOST#0OneDrive host siteThe root of your -my.sharepoint.com address.

You’ll also see a few system sites like POINTPUBLISHINGHUB#0 under /portals. Leave those alone. For the tenant’s SPFx site, see the SharePoint Online app catalog tutorial, and for private channels, creating a private channel in Teams.

Get-PnPSiteTemplate Exports a Provisioning Template (a Different Thing)

Get-PnPSiteTemplate doesn’t return a template ID. It exports a PnP provisioning template, an XML (or .pnp) file describing the site’s lists, columns, pages and settings, so you can rebuild it elsewhere.

Here’s a short example that exports only the regional settings of the SPGuides site:

Connect-PnPOnline -Url "https://spguides.sharepoint.com/sites/SPGuides" -ClientId $clientId -Interactive

Get-PnPSiteTemplate -Out ".\SPGuides-template.xml" -Handlers RegionalSettings -Force

The file was 825 bytes. The only place the template ID shows up is the BaseSiteTemplate attribute, which says GROUP#0:

Get-PnPSiteTemplate exporting a PnP provisioning template XML with BaseSiteTemplate GROUP#0

How does this work?

-Out picks the format from the file extension, -Handlers limits what gets extracted, and -Force overwrites an existing file. Without -Handlers, it extracts everything, which takes much longer on a busy site.

If what you really want is a reusable template people can pick from the site’s Settings menu, that’s a site design, not this. I cover that in creating a custom site template in SharePoint Online.

Which Method Should You Use?

You want to …Use this
Check one site collection’s templateGet-PnPTenantSite -Identity (Method 1)
Check a subsite, or you aren’t an adminGet-PnPWeb -Includes WebTemplate, Configuration (Method 2)
Report on every siteGet-PnPTenantSite | Group-Object Template (Method 3)
Find all sites of one typeGet-PnPTenantSite -Template (Method 4)
Stay in the SharePoint Online Management ShellGet-SPOSite -Limit ALL (Method 5)
See which templates you can create sites fromGet-PnPWebTemplates or Get-SPOWebTemplate
Copy a site’s structure to another siteGet-PnPSiteTemplate

Not sure how to connect with either module? My guide to connecting to SharePoint Online using PowerShell covers both.

Things to Keep in Mind

  • You can’t change a site’s template. The ID is fixed when the site is created. To move from classic to modern, you build a new site; see SharePoint classic vs modern.
  • Template strings come back in mixed case. Compare with -eq or -in, which ignore case, so SitePagePublishing#0 and SITEPAGEPUBLISHING#0 both match.
  • OneDrive is excluded by default. Add -IncludeOneDriveSites (PnP) or -IncludePersonalSite $true (SPO) when you need it.
  • Tenant cmdlets need admin access. Get-PnPTenantSite, Get-PnPWebTemplates and Get-SPOSite all need the SharePoint admin center; Get-PnPWeb only needs access to the site.

Once you know your site types, these guides help with the next round of tenant work:

Frequently Asked Questions

What is STS#3 in SharePoint?

STS#3 is the modern team site that isn’t connected to a Microsoft 365 group, listed as “Team site (no Microsoft 365 group)”. It’s the template you pass to New-PnPTenantSite or New-SPOSite for a modern team site without a group.

What is the difference between STS#0, STS#1 and STS#3?

All three use the STS site definition with a different configuration. STS#0 is the classic team site, STS#1 is the classic blank site, and STS#3 is the modern team site without a group. Only STS#0 and STS#3 are offered for new sites in SharePoint Online.

What does GROUP#0 mean in SharePoint?

GROUP#0 is a team site connected to a Microsoft 365 group, the kind Teams and Outlook create. It’s for reporting only: create these sites with New-PnPSite -Type TeamSite, not with a template ID.

Does Get-PnPSiteTemplate return the site template ID?

No. It exports a PnP provisioning template (XML or .pnp) with the site’s lists, fields and settings. The ID only appears as the BaseSiteTemplate attribute. See the Get-PnPSiteTemplate reference. Use Get-PnPTenantSite or Get-PnPWeb to read the ID.

How do I list templates with Get-SPOWebTemplate?

Connect with Connect-SPOService to your admin center URL and run Get-SPOWebTemplate. Add -LocaleId for another language or -Name for one template. Microsoft’s Get-SPOWebTemplate documentation lists every parameter.