How to Create a SharePoint Modern Site With PnP Powershell (2024)

Last Updated on July 27, 2023

It has been a while since Microsoft released modern pages for SharePoint.

Since most people still use the older, classic sites, not everyone knows how to create a SharePoint modern site using PnP PowerShell.

Fortunately, it is not really that complicated. By following this tutorial, you can be done in only a few minutes.

There is no need to worry about the code since all you have to do is copy and paste them.

Let’s start!

Table of Contents:

  • What is a modern site in SharePoint?
  • What are the types of modern sites you can create?
    • Should you create a team site or a communication site?
  • How to create a modern site in SharePoint?
    • The Manual Method
    • Using PnP PowerShell
      • How to install PnP PowerShell
      • How to use PnP PowerShell

As its name suggests, a modern site in SharePoint is a complete design overhaul of how classic sites look.

If you can have used the new Microsoft 365 applications, then you will see some semblance in the design.

Here is a screenshot of what a SharePoint modern site page looks like (taken from the SharePoint Look Book):

How to Create a SharePoint Modern Site With PnP Powershell (1)

All modern sites are designed to work flawlessly on mobile.

The user interface, even on mobile, is so much better compared with that of a classic site. Editing a modern page also feels like you are using a modern page builder like WordPress.

Here is an example of what a classic site looks like:

How to Create a SharePoint Modern Site With PnP Powershell (2)

In the case of a classic site, you will have to configure the design yourself for it to look good on mobile.

This is a known issue since classic sites do not shrink or respond according to the screen size that you are using.

Be that as it may, the fortunate truth is that there is a way to transform a classic site into a modern site, albeit not that easy.

That is why if you are planning on creating a SharePoint site, better go straight to modern.

Sign up for exclusive updates, tips, and strategies

What are the types of modern sites you can create?

Basically, there are two types of modern sites that you can make:

  1. Team
  2. Communication

A modern team site is more like a project site or a department site that teams use to collaborate.

It is a place where you and your team can share content, information, and various apps like Teams, Planner, and Outlook.

Here is an example of a modern team site:

How to Create a SharePoint Modern Site With PnP Powershell (3)

On the other hand, a modern communication site is a place where you can share vast information with others like news, reports, and updates.

A communication site always looks more appealing as everyone in the organization visits it regularly.

Here is an example of a modern communication site:

How to Create a SharePoint Modern Site With PnP Powershell (4)

Should you create a team site or a communication site?

Since the introduction of communication sites, some users are confused about whether they should build a team site or a communication site.

Before, classic sites look more or less similar to a team site.

Once you try creating either one, you will realize that there is a vast difference between the two.

For example, you will notice that a team site has a quick launch menu on its left-hand side pane, which is why it is often called an Office 365 group site template.

You will be able to open various apps right away.

Related: Using Site Templates in SharePoint Online: Beginner’s Guide

That same quick launch menu is absent on a communication site.

The reason for this is that you do not get any other apps like Planner or Teams with a communication site. What you get is a modern site that looks like a customer-facing site.

Some use cases for a team site include:

  • Project sites
  • Client sites
  • Department sites

Some use cases for a communication site include:

  • New product launch site
  • Employee-facing site
  • Internet landing page

If you are still confused, remember this:

For collaboration purposes, build a team site. If you need a place to make certain announcements or post updates to let the whole organization know about the news, then build a communication site.

Creating a modern site in SharePoint is easy, especially with the manual method.

The second method will require that you have some knowledge of how to use PnP PowerShell, which is what I will show you later on.

The Manual Method

If you are using SharePoint Online, then this method is the most intuitive to use. All it requires of you is to click a few buttons, enter some details, and you’re done.

The first step is to log in to your root site. No matter where you land, all you need to do is click on the app launcher and select “SharePoint” from the list of apps.

How to Create a SharePoint Modern Site With PnP Powershell (5)

Once you’re there, the next step is to click on the “Create site” button. Then, select the type of modern site that you want to create.

How to Create a SharePoint Modern Site With PnP Powershell (6)

If you create a team site, you will have to provide the following:

  • Site name (mandatory)
  • Group email address
  • Site address (automatic)
  • Site description (mandatory)
  • Privacy settings
  • Default site language
How to Create a SharePoint Modern Site With PnP Powershell (7)

The next window will also enable you to add additional owners and members. If you don’t have anything to add, simply click “Finish” and your team site will be created.

How to Create a SharePoint Modern Site With PnP Powershell (8)

If you want to create a communication site, you will have to provide the following:

  • Design (Topic, Showcase, Blank)
  • Site name (mandatory)
  • Site address (automatic)
  • Site description (mandatory)
  • Default site language
How to Create a SharePoint Modern Site With PnP Powershell (9)

After clicking “Finish”, your communication site will be created.

Using PnP PowerShell

To create a modern site using PnP PowerShell, you need to install it first in SharePoint Online, which will cover the first part of this section.

If you already have the latest module installed, you can step the steps below.

How to install PnP PowerShell

On your computer, open Windows PowerShell and run it as an administrator.

How to Create a SharePoint Modern Site With PnP Powershell (10)

Then, run the command below on Windows PowerShell (copy-paste it to the interface and hit “Enter”).

Install-Module SharePointPnPPowerShellOnline

If the latest module is already installed, nothing will happen. Otherwise, an installation will take place. To proceed, simply agree to the installation prompt.

How to Create a SharePoint Modern Site With PnP Powershell (11)

Run two more commands on PowerShell. What these will do is enable you to avoid any blocked error messages when using the PnP PowerShell.

Get-ExecutionPolicySet-ExecutionPolicy RemoteSigned

It should look like this:

How to Create a SharePoint Modern Site With PnP Powershell (12)

How to use PnP PowerShell

Naturally, the way to do this is through code. Fortunately, it’s not really that hard to do as you only have to copy and paste the code in here.

To start, open Windows PowerShell ISE and run it as an administrator.

How to Create a SharePoint Modern Site With PnP Powershell (13)

To create a modern team site, change some of the details on the code below, copy and paste it to PowerShell ISE, and run it.

# Connect to SharePoint Online# This command will prompt the sign-in UI to authenticateConnect-PnPOnline -Url https://yoursite.sharepoint.com;# Create the new "modern" team site$teamSiteUrl = New-PnPSite -Type TeamSite -Title "New Modern Team Site" -Alias "newmodernteamsite" -Description "description" -IsPublic

Make sure to change the following:

  • SharePoint site URL
  • Title
  • Alias
  • Description
How to Create a SharePoint Modern Site With PnP Powershell (14)

As for creating a new modern communications site, here is the script:

# Connect to SharePoint Online# This command will prompt the sign-in UI to authenticateConnect-PnPOnline -Url https://yoursite.sharepoint.com;# Create the new "modern" communication site$communicationSiteUrl = New-PnPSite -Type CommunicationSite -Title "New Modern Communication Site" -Url "https://yoursite.sharepoint.com/sites/newmoderncommunicationsite" -Description "description" -Classification "classification" -SiteDesign Topic

Make sure to change the following:

  • SharePoint site URL
  • Title
  • New modern communication site URL
  • Description
  • Site Design (Topic, Showcase, Blank)
How to Create a SharePoint Modern Site With PnP Powershell (15)

You can then check your SharePoint admin to see the new sites:

How to Create a SharePoint Modern Site With PnP Powershell (16)

That’s it! If you have any other questions, feel free to leave a comment below or send me a direct message via the contact page.

How to Create a SharePoint Modern Site With PnP Powershell (2024)

References

Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5374

Rating: 4.1 / 5 (42 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.