Create a Modern SharePoint Site with PowerShell


Modern SharePoint sites can be created directly from the SharePoint admin center, but PowerShell is useful when you need to automate site provisioning, create multiple sites, or incorporate site creation into a larger administrative process.

PnP PowerShell provides the New-PnPSite cmdlet for creating modern SharePoint sites.

Depending on your requirements, you can create:

  • A modern Team Site connected to a Microsoft 365 Group
  • A modern Team Site without a Microsoft 365 Group
  • A Communication Site

This guide covers each option.

Note: Older versions of this guide used the retired SharePointPnPPowerShellOnline module along with New-PnPTenantSite. The current PnP PowerShell module uses New-PnPSite for provisioning modern SharePoint sites.

Install PnP PowerShell

First, install the current PnP PowerShell module:

Install-Module PnP.PowerShell

If PnP PowerShell is already installed, you can update it using:

Update-Module PnP.PowerShell

Connect to SharePoint Online

PnP PowerShell requires an Entra ID application registration for authentication.

For interactive authentication, connect using:

Connect-PnPOnline -Url https://YourTenantName.sharepoint.com -Interactive -ClientId <Your-Entra-App-Client-ID>

Replace:

YourTenantName

with your Microsoft 365 tenant name.

Replace:

<Your-Entra-App-Client-ID>

with the Application (client) ID of the Entra ID application registration configured for PnP PowerShell.

Since September 9, 2024, PnP PowerShell requires you to use your own Entra ID application registration when authenticating interactively.

If you do not already have an application registration configured for PnP PowerShell, one can be created using:

Register-PnPEntraIDAppForInteractiveLogin -ApplicationName "PnP.PowerShell" -Tenant YourTenantName.onmicrosoft.com

The permissions assigned to the application should be limited to those required for the administrative operations you plan to perform.

Option 1: Create a Modern Team Site Without a Microsoft 365 Group

A modern Team Site can be created without creating an associated Microsoft 365 Group.

This can be useful for SharePoint-focused sites where Microsoft 365 Group services such as a shared mailbox, Planner, or group membership are not required.

Use:

New-PnPSite `
 -Type TeamSiteWithoutMicrosoft365Group `
 -Title "SiteName1" `
 -Url "https://YourTenantName.sharepoint.com/sites/SiteName1" `
 -Owner "admin@YourTenantName.com" `
 -Lcid 1033

The important parameter is:

-Type TeamSiteWithoutMicrosoft365Group

This creates a modern SharePoint Team Site without provisioning an underlying Microsoft 365 Group.

The -Owner parameter specifies the Site Collection Administrator for the new site.

-Lcid 1033 configures the site using the English (United States) locale.

Option 2: Create a Microsoft 365 Group-Connected Team Site

If the SharePoint site should be associated with a Microsoft 365 Group, use:

New-PnPSite `
 -Type TeamSite `
 -Title "SiteName1" `
 -Alias "SiteName1" `
 -Owners "admin@YourTenantName.com" `
 -Wait

The key parameter is:

-Type TeamSite

This creates a modern Team Site along with an associated Microsoft 365 Group.

The -Alias value is used for the Microsoft 365 Group and normally influences the URL created for the SharePoint site.

For example:

-Alias "ProjectFalcon"

would typically result in a site similar to:

https://YourTenantName.sharepoint.com/sites/ProjectFalcon

The exact managed path can vary depending on the SharePoint configuration.

Unlike a non-group-connected site, this type of site also creates the underlying Microsoft 365 Group.

Option 3: Create a Communication Site

Communication Sites are generally intended for publishing information to a broader audience rather than team collaboration.

Examples include:

  • Department portals
  • Intranets
  • Company news sites
  • Knowledge sites
  • Organizational resource sites

To create one:

New-PnPSite `
 -Type CommunicationSite `
 -Title "Corporate Communications" `
 -Url "https://YourTenantName.sharepoint.com/sites/CorporateCommunications" `
 -Owner "admin@YourTenantName.com"

The important parameter is:

-Type CommunicationSite

You can also specify one of the built-in Communication Site designs.

For example:

New-PnPSite `
 -Type CommunicationSite `
 -Title "Corporate Communications" `
 -Url "https://YourTenantName.sharepoint.com/sites/CorporateCommunications" `
 -Owner "admin@YourTenantName.com" `
 -SiteDesign Topic

Available built-in Communication Site designs include:

  • Blank
  • Topic
  • Showcase

Creating Multiple Modern SharePoint Sites

PowerShell becomes particularly useful when multiple sites need to be provisioned.

For example:

New-PnPSite `
 -Type TeamSiteWithoutMicrosoft365Group `
 -Title "SiteName1" `
 -Url "https://YourTenantName.sharepoint.com/sites/SiteName1" `
 -Owner "admin@YourTenantName.com"

New-PnPSite `
 -Type TeamSiteWithoutMicrosoft365Group `
 -Title "SiteName2" `
 -Url "https://YourTenantName.sharepoint.com/sites/SiteName2" `
 -Owner "admin@YourTenantName.com"

For larger deployments, the site names, URLs, owners, and other settings can also be imported from a CSV file and processed through PowerShell.

New-PnPSite vs. New-PnPTenantSite

Older SharePoint provisioning scripts commonly used:

New-PnPTenantSite

along with a template such as:

-Template "STS#3"

While you may still encounter this syntax in older scripts and documentation, current PnP PowerShell separates modern and classic site provisioning.

For modern sites, use:

New-PnPSite

PnP currently supports the following modern site types through this cmdlet:

TeamSite
TeamSiteWithoutMicrosoft365Group
CommunicationSite

New-PnPTenantSite is intended for scenarios where a classic SharePoint site collection needs to be created.

Using New-PnPSite also makes the intended site architecture much clearer than relying on legacy SharePoint template identifiers such as STS#3.

Required Permissions

The permissions required depend on the type of site being created and the authentication method being used.

PnP PowerShell currently documents SharePoint full-control permissions for creating site collections.

Creating a Microsoft 365 Group-connected Team Site also requires Microsoft Graph permissions because the underlying Microsoft 365 Group must be created.

For delegated authentication, the signed-in administrator must also have sufficient SharePoint permissions to create site collections unless self-service site creation has been enabled.

Always configure the PnP Entra ID application with only the permissions required for the operations being performed.

Verify the New SharePoint Site

After the command completes, open the SharePoint admin center and navigate to:

Sites → Active sites

Locate the newly created site.

You can also browse directly to the URL specified during provisioning.

For example:

https://YourTenantName.sharepoint.com/sites/SiteName1

Verify that:

  1. The site was successfully created.
  2. The correct site type was provisioned.
  3. The expected owner was assigned.
  4. The site URL is correct.
  5. The appropriate Microsoft 365 Group was created if a group-connected Team Site was selected.

Which Site Type Should You Use?

The site type should be based on how the SharePoint site will be used.

TeamSite

Use when users will collaborate through a Microsoft 365 Group and may also use services such as Teams, Planner, or a shared group mailbox.

TeamSiteWithoutMicrosoft365Group

Use when you need a modern SharePoint collaboration site but do not want an associated Microsoft 365 Group.

CommunicationSite

Use when the primary purpose of the site is publishing information to a larger audience.

Choosing the appropriate site type during provisioning helps avoid creating unnecessary Microsoft 365 Groups and provides a SharePoint architecture that better matches the intended use of the site.

Summary

Modern SharePoint sites can be provisioned using the current PnP.PowerShell module and the New-PnPSite cmdlet.

For a modern Team Site without a Microsoft 365 Group:

New-PnPSite -Type TeamSiteWithoutMicrosoft365Group

For a Microsoft 365 Group-connected Team Site:

New-PnPSite -Type TeamSite

For a Communication Site:

New-PnPSite -Type CommunicationSite

Older scripts that use SharePointPnPPowerShellOnline, New-PnPTenantSite, and STS#3 should be reviewed and updated when the goal is to provision modern SharePoint sites.

References


Found this useful? Share with others:

people found this article helpful. What about you?