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 Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

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

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading