If you need to create a lot of sites (for example, setting up infrastructure for a new company or division or creating similar structures in multiple tenants), you may want to do these tasks via PowerShell:
- Download and install the latest version of the SharePoint Online Management Shell from https://go.microsoft.com/fwlink/p/?LinkId=255251.
If you have multi-factor authentication enabled for your account, you will see a modern authentication dialog box when connecting. Additionally, these examples require the SharePoint Online PowerShell module, which currently only works on Windows-based machines. It will not work on PowerShell Core at this time.
- Launch PowerShell and import the SharePoint Online module:
Import-Module SharePointOnline
- Once it has been imported, you'll need to connect to SharePoint Online (if you are using multi-factor authentication for your account, you will need to omit the -Credential parameter):
Connect-SPOService -Credential (Get-Credential) -Url https://<tenant>-admin.sharepoint.com
- Retrieve the list of available templates for creating your sites:
Get-SPOWebTemplate
- View the templates listed. Select the value in the Name column that matches the type of site you wish to create. The list of templates available to you is limited by your license subscription:
Name | Title | LocaleId | CompatibilityLevel |
---|---|---|---|
STS#3 | Team site (no Office 365 group) | 1033 | 15 |
STS#0 | Team site (classic experience) | 1033 | 15 |
BLOG#0 | Blog | 1033 | 15 |
BDR#0 | Document Center | 1033 | 15 |
DEV#0 | Developer Site | 1033 | 15 |
OFFILE#1 | Records Center | 1033 | 15 |
EHS#1 | Team Site - SharePoint Online configuration | 1033 | 15 |
BICENTERSITE#0 | Business Intelligence Center | 1033 | 15 |
SRCHCEN | Enterprise Search Center | 1033 | 15 |
BLANKINTERNETCONTAINER#0 | Publishing Portal | 1033 | 15 |
ENTERWIKI#0 | Enterprise Wiki | 1033 | 15 |
PROJECTSITE#0 | Project Site | 1033 | 15 |
PRODUCTCATALOG#0 | Product Catalog | 1033 | 15 |
COMMUNITY#0 | Community Site | 1033 | 15 |
COMMUNITYPORTAL#0 | Community Portal | 1033 | 15 |
SITEPAGEPUBLISHING#0 | Communication site | 1033 | 15 |
SRCHCENTERLITE#0 | Basic Search Center | 1033 | 15 |
VISPRUS#0 | Visio Process Repository | 1033 | 15 |
- Create the site substituting the value in the Name column for the type of site you want to create:
New-SPOSite -Url https://<tenant>.sharepoint.com/sites/<sitename> -Owner [email protected] -StorageQuota 100 -NoWait -ResourceQuota 50 -Template <TemplateName>
SharePoint Online cmdlets differ from their on-premises counterparts in that the nouns begin with SPO as opposed to the on-premises versions beginning with SP. For example, in SharePoint Server, the Get-SPSite cmdlet lists the sites available on the farm. In SharePoint Online, the corresponding cmdlet is Get-SPOSite.