[SPO] Creating modern sites using PowerShell/PNP

Modern SharePoint sites use the following templates:

Template ID Title Description / Additional Info
STS#3 Team site (no Office 365 group) A site with no connection to an Office 365 Group.
SITEPAGEPUBLISHING#0 Communication site Publish dynamic, beautiful content to people in your organization to keep them informed and engaged on topics, events, or projects.
GROUP#0 Office 365 Group associated Team Site For Reporting Only – You cannot create sites with this template
POINTPUBLISHINGPERSONAL#0 Delve Blog For Reporting Only – note that Delve Blogs are being retired
SPSPERS#10 OneDrive for Business personal Site For Reporting Only – Use the Request-SPOPersonalSite cmdlet to pre-provision a OneDrive for Business site
RedirectSite#0 Redirect Site Placeholder template for the old URL when you rename the Site URL. This is for reporting only and those sites are only created by Microsoft programmatically.
TEAMCHANNEL#0 Teams Private Channel Site Lightweight Site Collection provisioned for each Teams Private Channel Site. This is For Reporting Only, and not for manual provisioning trough SharePoint Online

Out of the 7 templates listed above, only 4 can be used to create a site collection using PowerShell:

New-SPOSite -Title “TemplatesTest1″ -Url https://tenant.sharepoint.com/sites/TemplateTest -Template ” STS#3″ -Owner andrei@tenant.com  -StorageQuota 1024

In case you want to use the SharePoint PNP module, you can use the following site types:

 

Site Type Title Description / Additional Info
CommunicationSite Communication site Publish dynamic, beautiful content to people in your organization to keep them informed and engaged on topics, events, or projects.
TeamSite Office 365 Group (including a Team Site of course) Creates a Office 365 group together with it’s team site!

and the PNP cmdlet look like:

New-PnPSite -Type CommunicationSite -Title TemplateNew1 -Url https://tenant.sharepoint.com/sites/TemplateNew1

New-PnPSite -Type TeamSite -Title ‘Team Contoso’ -Alias contoso — This will create a new Modern Team Site collection with the title ‘Team Contoso’ and the url ‘https://tenant.sharepoint.com/sites/contoso’ or ‘https://tenant.sharepoint.com/teams/contoso’ based on the managed path configuration in the SharePoint Online Admin portal.

 

Using the New-PnPSite PowerShell cmdlet, you can also specify which type of Communication Site you want out of the three default ones by providing the name in the -SiteDesign parameter as in the example below.

New-PnPSite-TypeCommunicationSite-TitleContoso-Urlhttps://tenant.sharepoint.com/sites/contoso-SiteDesignShowcase

More info here: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/new-pnpsite?view=sharepoint-ps

If you still want to use PNP PowerShell to use any of the modern site templates shown above, you can use the New-PNPTenantSite cmdlet:

New-PnPTenantSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Owner andrei@tenant.com  -TimeZone 4 -Template STS#3

And last, but not least, the classic SharePoint site templates:

Template ID Title Description
STS#0 Classic Team Site A place to work together with a group of people.
APPCATALOG#0 App Catalog Site A site for sharing apps for SharePoint and Office
BDR#0 Document Center A site to centrally manage documents in your enterprise
BICenterSite#0 Business Intelligence Center A site for presenting Business Intelligence content in SharePoint.
BLANKINTERNETCONTAINER#0 Publishing Portal A starter site hierarchy for an Internet-facing site or a large intranet portal. This site can be customized easily with distinctive branding. It includes a home page, a sample press releases subsite, a Search Center, and a login page. Typically, this site has many more readers than contributors, and it is used to publish Web pages with approval workflows.
BLOG#0 Blog A site for a person or team to post ideas, observations, and expertise that site visitors can comment on.
COMMUNITY#0 Community Site A place where community members discuss topics of common interest. Members can browse and discover relevant content by exploring categories, sorting discussions by popularity or by viewing only posts that have a best reply. Members gain reputation points by participating in the community, such as starting discussions and replying to them, liking posts and specifying best replies.
COMMUNITYPORTAL#0 Community Portal A site for discovering communities.
DEV#0 Developer Site A site for developers to build, test and publish apps for Office
ENTERWIKI#0 Enterprise Wiki A site for publishing knowledge that you capture and want to share across the enterprise. It provides an easy content editing experience in a single location for co-authoring content, discussions, and project management.
OFFILE#1 Records Center This template creates a site designed for records management. Records managers can configure the routing table to direct incoming files to specific locations. The site also lets you manage whether records can be deleted or modified after they are added to the repository.
PRODUCTCATALOG#0 Product Catalog A site for managing product catalog data which can be published to an internet-facing site through search. The product catalog can be configured to support product variants and multilingual product properties. The site includes admin pages for managing faceted navigation for products.
PROJECTSITE#0 Project Site A site for managing and collaborating on a project. This site template brings all status, communication, and artifacts relevant to the project into one place.
SRCHCEN#0 Enterprise Search Center A site focused on delivering an enterprise-wide search experience. Includes a welcome page with a search box that connects users to four search results page experiences: one for general searches, one for people searches, one for conversation searches, and one for video searches. You can add and customize new results pages to focus on other types of search queries.
SRCHCENTERLITE#0 Basic Search Center A site focused on delivering a basic search experience. Includes a welcome page with a search box that connects users to a search results page, and an advanced search page. This Search Center will not appear in navigation.
visprus#0 Visio Process Repository A site for viewing, sharing, and storing Visio process diagrams. It includes a versioned document library and templates for Basic Flowcharts, Cross-functional Flowcharts, and BPMN diagrams.

Enjoy!