New-PnPSite

Creates a new site collection

Syntax

New-PnPSite
   -Title <String>
              -Url <String>
              -Type <SiteType>
              [-Description <String>]
              [-Classification <String>]
              [-AllowFileSharingForGuestUsers [<SwitchParameter>]]
              [-SiteDesign <CommunicationSiteDesign>]
              [-Lcid <UInt32>]
              [-Connection <SPOnlineConnection>]
New-PnPSite
   -Title <String>
              -Alias <String>
              -Type <SiteType>
              [-Lcid <UInt32>]
              [-Description <String>]
              [-Classification <String>]
              [-IsPublic <String>]
              [-Connection <SPOnlineConnection>]
New-PnPSite
   -Title <String>
              -Url <String>
              -SiteDesignId <GuidPipeBind>
              -Type <SiteType>
              [-Description <String>]
              [-Classification <String>]
              [-AllowFileSharingForGuestUsers [<SwitchParameter>]]
              [-Lcid <UInt32>]
              [-Connection <SPOnlineConnection>]

Description

The New-PnPSite cmdlet creates a new site collection for the current tenant. Currently only 'modern' sites like Communication Site and the Modern Team Site are supported. If you want to create a classic site, use New-PnPTenantSite.

Examples

------------------EXAMPLE 1------------------

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

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'

------------------EXAMPLE 2------------------

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesign Showcase

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. It will use the 'Showcase' design for the site.

------------------EXAMPLE 3------------------

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesignId ae2349d5-97d6-4440-94d1-6516b72449ac

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. It will use the specified custom site design for the site.

------------------EXAMPLE 4------------------

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Classification "HBI"

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. The classification for the site will be set to "HBI"

------------------EXAMPLE 5------------------

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -ShareByEmailEnabled

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. Allows owners to invite users outside of the organization.

------------------EXAMPLE 6------------------

New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Lcid 1044

This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' and sets the default language to Italian.

------------------EXAMPLE 7------------------

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.

------------------EXAMPLE 8------------------

New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -IsPublic

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 and sets the site to public.

------------------EXAMPLE 9------------------

New-PnPSite -Type TeamSite -Title 'Team Contoso' -Alias contoso -Lcid 1040

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 and sets the default language of the site to Italian.

Required Parameters

-Alias

Specifies the alias of the new site collection which represents the part of the URL that will be assigned to the site behind 'https://tenant.sharepoint.com/sites/' or 'https://tenant.sharepoint.com/teams/' based on the managed path configuration in the SharePoint Online Admin portal

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-SiteDesignId

Specifies the site design id to use for the new site collection. If specified will override SiteDesign

Type:GuidPipeBind
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Title

Specifies the title of the new site collection

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Type

@Specifies with type of site to create.

Type:SiteType
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Url

Specifies the full url of the new site collection

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-AllowFileSharingForGuestUsers

Specifies if guest users can share files in the new site collection

Type:SwitchParameter
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Classification

Specifies the classification of the new site collection

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Connection

Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type:SPOnlineConnection
Position:Named
Accept pipeline input:False
Accept wildcard characters:False
-Description

Specifies the description of the new site collection

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-IsPublic

Specifies if new site collection is public. Defaults to false.

Type:String
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-Lcid

Specifies the language of the new site collection. Defaults to the current language of the web connected to.

Type:UInt32
Position:0
Accept pipeline input:False
Accept wildcard characters:False
-SiteDesign

Specifies the site design of the new site collection. Defaults to 'Topic'

Type:CommunicationSiteDesign
Position:0
Accept pipeline input:False
Accept wildcard characters:False

Outputs

System.String

Returns the url of the newly created site collection