Find Base List Template ID
This PnP PowerShell script returns the base template name and template ID of any SharePoint Online list or library. Useful when building provisioning scripts that require a specific template type, or when auditing lists to understand how they were created.
Purpose
The script retrieves two key properties from a target list:
- TemplateTypeDisplayName — the human-readable template name (e.g. Document Library, Generic List, Calendar)
- BaseTemplate — the numeric template ID used in provisioning and schema definitions (e.g. 101 for Document Library, 100 for Generic List)
Prerequisites
- PnP.PowerShell module installed
- Read access to the target SharePoint site
PowerShell Script
$ClientId = ""
$SiteUrl = "https://tenantName.sharepoint.com/sites/siteName"
Connect-PnPOnline -Url $SiteUrl -Interactive -ClientId $ClientId
$list = Get-PnPList -Identity "listName"
Write-Output "List Template Name: $($list.TemplateTypeDisplayName)"
Write-Output "List Template ID: $($list.BaseTemplate)"
Usage Notes
- Update
$SiteUrlto the URL of the site containing the target list - Update
$ClientIdwith your Azure AD app registration client ID, or leave blank to use interactive login without a registered app - Replace
listNameinGet-PnPList -Identity "listName"with the exact internal name or display name of your list - Common template IDs:
100= Generic List,101= Document Library,119= Site Pages,544= MicroFeed