Small Tips and Tricks – PowerShell – creating communication site – resolving error – New-SPOSite : The web template SITEPUBLISHING#0 is not available for sites on this tenant

Hi All,

Greetings for the day!!!

Today new issue and solution 🙂

Background

  • In one of scenario we need to automate the process of creating COMMUNICATION sites
  • So PowerShell is the option – New-SPOSite
  • I am testing by creating a single site collection with PowerShell
  • For communication site I thought template will be SITEPUBLISHING#0 but then got the issue with this template

Issue – Error while creating communication site with PowerShell – New-SPOSite : The web template SITEPUBLISHING#0 is not available for sites on this tenant

fig : Microsoft 365 - PowerShell - New-SPOSite - creating new communication site - error
fig : Microsoft 365 – PowerShell – New-SPOSite – creating new communication site – error

Solution

  • It seems to be template getting used is wrong one- SITEPUBLISHING#0
  • To know the available template in a tenant we have PowerShell CMDLET – Get-SPOWebTemplate

PS C:\> Get-SPOWebTemplate

output:

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

fig : Microsoft 365 - PowerShell - Getting available templates in Tenant - Get-SPOWebTemplate
fig : Microsoft 365 – PowerShell – Getting available templates in Tenant – Get-SPOWebTemplate
  • If we notice, correct template for communication site is – SITEPAGEPUBLISHING#0
fig : Microsoft 365 - PowerShell - Template for creating communication site - SITEPAGEPUBLISHING#0
fig : Microsoft 365 – PowerShell – Template for creating communication site – SITEPAGEPUBLISHING#0
  • As we are using correct template , communication site created successfully
New-SPOSite -Url "https://knowledgejunction1.sharepoint.com/sites/sitewithpowershell" -Owner "prasham@knowledgejunction1.onmicrosoft.com" -StorageQuota 20480 -Title "Communication site with PowerShell" -Template "SITEPAGEPUBLISHING#0"

fig : Microsoft 365 - PowerShell - communication site created with New-SPOSite PowerShell CMDLET
fig : Microsoft 365 – PowerShell – communication site created with New-SPOSite PowerShell CMDLET

Thanks all for reading 🙂 HAVE a FANTASTIC LEARNING AHEAD !!!

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: