SharePoint Online - Unable to use the correct site template

asked 2020-08-24T12:47:31.437+00:00
Roland v.'t Kruys 1 Reputation point

I am running a Windows 10 Professional machine with the latest version of PowerShell and running the following modules: AzureAD, SharePointPnPPowerShellOnline 3.24.2008.1 and MicrosoftTeams 1.1.4

I am trying to write a PowerShell script to automate Team (Microsoft teams) creations. During the development, I've noticed that the template is constantly wrong. When I run the Get-SPOWebTemplate cmdlet, I am getting the following as available:


But when running the following script, it displays a different template:

#Define Config Variables   
#Install-Module -Name SharePointPnPPowerShellOnline -Force  
#Import-Module -Name SharePointPnPPowerShellOnline  
$AdminCenterURL = ""  
$SiteURL = ""  
$SiteTitle = "DK.Clients - 3"  
$SiteOwner = ""  
$Template = "EHS#1"  
$Timezone = 3 #(GMT+01:00) Brussels, Copenhagen, Madrid, Paris     
    #Connect to Tenant Admin      
    Connect-SPOService -URL  
    #Check if site exists already   
    $Site = Get-SPOSite -Limit ALL | Where {$_.Url -eq $SiteURL}  
    $DeletedSite = Get-SPODeletedSite -Limit ALL | Where {$_.Url -eq $SiteURL}   
    If ($Site -eq $null) {  
        If ($DeletedSite -ne $null) {   
        Remove-SPODeletedSite -Identity $SiteURL  
        write-host "Site $($SiteURL) was found in Recycle Bin and is now permanently deleted." -foregroundcolor Yellow  
        #sharepoint online pnp powershell to create communication site   
        New-SPOSite -Url $SiteURL -Owner $SiteOwner -StorageQuota 1024 -LocaleID 1033 -Template $Template -TimeZoneId $Timezone -Title $SiteTitle  
        write-host "Site Collection $($SiteURL) created successfully!" -foregroundcolor Green   
    else {   
        write-host "Site $($SiteURL) exists already! Create a new URL and rerun the script." -foregroundcolor Yellow   
catch {   
    write-host "Error: $($_.Exception.Message)" -foregroundcolor Red   

In the SharePoint Admin Center, it is display as: Team site (classic experience) instead of Team site. I have tried GROUP#0 and EHS#1 without success. When I manually create a new Team site, it uses the GROUP#0 template. But this is not possible using a PowerShell command.


  1. Is there a limitation or bug in New-SPOSite?
  2. Or am I overlooking something?
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
5,977 questions
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2020-08-24T15:23:37.327+00:00
    Trevor Seward 11,491 Reputation points Microsoft MVP

    If you're trying to automate Microsoft Teams creation, use the Teams PowerShell module: