Skip to main content

spo site add

Creates new SharePoint Online site

Usage

m365 spo site add [options]

Options

--type [type]

Type of sites to add. Allowed values TeamSite, CommunicationSite, ClassicSite, default TeamSite

-t, --title <title>

Site title

-a, --alias [alias]

Site alias, used in the URL and in the team site group e-mail (applies to type TeamSite)

-u, --url [url]

Site URL (applies to type CommunicationSite, ClassicSite)

-z, --timeZone [timeZone]

Integer representing time zone to use for the site (applies to type ClassicSite)

-d, --description [description]

Site description

-l, --lcid [lcid]

Site language in the LCID format, eg. 1033 for en-US. See SharePoint documentation for the list of supported languages

--owners [owners]

Comma-separated list of users to set as site owners (applies to type TeamSite, ClassicSite)

--isPublic

Determines if the associated group is public or not (applies to type TeamSite)

-c, --classification [classification]

Site classification (applies to type TeamSite, CommunicationSite)

--siteDesign [siteDesign]

Type of communication site to create. Allowed values Topic, Showcase, Blank, default Topic. When creating a communication site, specify either siteDesign or siteDesignId (applies to type CommunicationSite)

--siteDesignId [siteDesignId]

Id of the custom site design to use to create the site. When creating a communication site, specify either siteDesign or siteDesignId (applies to type CommunicationSite)

--shareByEmailEnabled

Determines whether it's allowed to share file with guests (applies to type CommunicationSite)

-w, --webTemplate [webTemplate]

Template to use for creating the site. Default STS#0 (applies to type ClassicSite)

--resourceQuota [resourceQuota]

The quota for this site collection in Sandboxed Solutions units. Default 0 (applies to type ClassicSite)

--resourceQuotaWarningLevel [resourceQuotaWarningLevel]

The warning level for the resource quota. Default 0 (applies to type ClassicSite)

--storageQuota [storageQuota]

The storage quota for this site collection in megabytes. Default 100 (applies to type ClassicSite)

--storageQuotaWarningLevel [storageQuotaWarningLevel]

The warning level for the storage quota in megabytes. Default 100 (applies to type ClassicSite)

--removeDeletedSite

Set, to remove existing deleted site with the same URL from the Recycle Bin (applies to type ClassicSite)

--withAppCatalog

Set, to create a site collection app catalog on the newly created site.

--wait

Wait for the site to be provisioned before completing the command (applies to type ClassicSite)

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks for classic sites

Using the -z, --timeZone option you have to specify the time zone of the site. For more information about the valid values see https://msdn.microsoft.com/library/microsoft.sharepoint.spregionalsettings.timezones.aspx.

The value of the --resourceQuota option must not exceed the company's aggregate available Sandboxed Solutions quota. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010: http://msdn.microsoft.com/en-us/library/gg615462.aspx.

The value of the --resourceQuotaWarningLevel option must not exceed the value of the --resourceQuota option.

The value of the --storageQuota option must not exceed the company's available quota.

The value of the --storageQuotaWarningLevel option must not exceed the the value of the --storageQuota option.

If you try to create a site with the same URL as a site that has been previously moved to the recycle bin, you will get an error. To avoid this error, you can use the --removeDeletedSite option. Prior to creating the site, the spo site add command will check if the site with the specified URL has been previously moved to the recycle bin and if so, will remove it. Because removing sites from the recycle bin might take a moment, it should be used in conjunction with the --wait option so that the new site is not created before the old site is fully removed.

Deleting and creating classic site collections is by default asynchronous and depending on the current state of Office 365, might take up to few minutes. If you're building a script with steps that require the site to be fully provisioned, you should use the --wait flag. When using this flag, the spo site add command will keep running until it received confirmation from Office 365 that the site has been fully provisioned.

Remarks for modern sites

The --owners option is mandatory for creating CommunicationSite sites with app-only permissions.

When trying to create a team site using app-only permissions, you will get an Insufficient privileges to complete the operation. error. As a workaround, you can use the entra m365group add command, followed by spo site set to further configure the Team site.

Examples

Create modern team site with private group

m365 spo site add --alias team1 --title "Team 1"

Create modern team site with description and classification

m365 spo site add --type TeamSite --alias team1 --title "Team 1" --description "Site of team 1" --classification LBI

Create modern team site with public group

m365 spo site add --type TeamSite --alias team1 --title "Team 1" --isPublic

Create modern team site using the Dutch language

m365 spo site add --alias team1 --title "Team 1" --lcid 1043

Create modern team site with the specified users as owners

m365 spo site add --alias team1 --title "Team 1" --owners "steve@contoso.com, bob@contoso.com"

Create a modern team site and enable the site collection app catalog

m365 spo site add --alias team1 --title "Team 1" --withAppCatalog

Create communication site using the Topic design

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing

Create communication site using app-only permissions

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing --owners "john.smith@contoso.com"

Create communication site using the Showcase design

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing --siteDesign Showcase

Create communication site using a custom site design

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing --siteDesignId 99f410fe-dd79-4b9d-8531-f2270c9c621c

Create communication site using the Blank design with description and classification

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing --description Site of the marketing department --classification MBI --siteDesign Blank

Create a communication site and enable the site collection app catalog

m365 spo site add --type CommunicationSite --url https://contoso.sharepoint.com/sites/marketing --title Marketing --withAppCatalog

Create a new classic site collection using the Team site template. Set time zone to UTC+01:00. Don't wait for the site provisioning to complete

m365 spo site add --type ClassicSite --url https://contoso.sharepoint.com/sites/team --title Team --owners admin@contoso.onmicrosoft.com --timeZone 4

Create a new classic site collection using the Team site template. Set time zone to UTC+01:00. Wait for the site provisioning to complete

m365 spo site add --type ClassicSite --url https://contoso.sharepoint.com/sites/team --title Team --owners admin@contoso.onmicrosoft.com --timeZone 4 --webTemplate STS#0 --wait

Create a new classic site collection using the Team site template. Set time zone to UTC+01:00. If a site with the same URL is in the recycle bin, delete it. Wait for the site provisioning to complete

m365 spo site add --type ClassicSite --url https://contoso.sharepoint.com/sites/team --title Team --owners admin@contoso.onmicrosoft.com --timeZone 4 --webTemplate STS#0 --removeDeletedSite --wait

Create a new classic site and enable the site collection app catalog

m365 spo site add --type ClassicSite --url https://contoso.sharepoint.com/sites/team --title Team --owners admin@contoso.onmicrosoft.com --timeZone 4 --webTemplate STS#0 --withAppCatalog

Response

"https://contoso.sharepoint.com/sites/marketing"

More information

CTRL + M