SharePoint Online: Create Site Collection Using PowerShell

This applies to SharePoint Online, SharePoint Online Enterprise (E3 and E4)

As we know, we can create new SPO Site, and Perform other administrative activities using SharePoint Online PowerShell. We can quickly and repeatedly perform tasks much faster than you can in the Office 356 admin center user interface. Being an Admin, we know many of SharePoint task cannot perform using UI which we can do using PowerShell easier.

  • As mentioned in the last articles, we have demonstrated how to create Site Collection Using UI have many steps. Using SPO PowerShell we can do the same with one line command. The New-SPOSite cmdlet creates a new site collection for the current company. 
  • You must have to install SharePoint Online Management shell in your local system, see this articles to install the SPO PowerShell.
  • To create SharePoint Online Site, you must have SC admin permission on tenant level.

We can use below parameter to create a New site collection in SharePoint online:

New-SPOSite

  [-CompatibilityLevel <Int32>]

  [-LocaleId <UInt32>]

  [-NoWait]

  -Owner <String>

  [-ResourceQuota <Double>]

  -StorageQuota <Int64>

  [-Template <String>]

  [-TimeZoneId <Int32>]

  [-Title <String>]

  -Url <UrlCmdletPipeBind>

  [<CommonParameters>]

Below are the steps to perform the above activity step by step with a screen shot:

  • Open SPO Management Shell with appropriate permission and execute below command, SharePoint Online is using different PowerShell tool than regular SharePoint command prompt. This is initial and necessary steps to get connection establish with your tenant, which stores the URL of the tenant administration site and the credentials used to connect to the site. 

Connect-SPOService -URL YourTenantURL

We can use below screenshot also

https://lh3.googleusercontent.com/2WZqI_yHn1tnKe5mGtH2oi5y0UZIrnUuWcldKLG4fJzG_1Bx3SbSVV50fj3IhkET3seABjJQKTUtctpWH-8qLglq06kIS3XRovzM15lH3-cs8M8nqEN5Jx9kHhRfVrNa6xpFafaf3ZYNm9jrLA

  • Once we are connected site SPO site, we can create new SharePoint Online Site collection using below line of command:
New-SPOSite -Url https://spsolutiontips.sharepoint.com/sites/prashant -Owner admin@spsolutiontips.onmicrosoft.com -StorageQuota 100 -Title "My First Site Test Site" -CompatibilityLevel 15 -LocaleID 1033 -ResourceQuota 30 -Template "STS#0" -NoWait

See below image for more details:

https://lh3.googleusercontent.com/A8w4Txi4YzwlHj4vXU-2GUiNaE8R_CE6655UBeUR9m3kKNIXS8JoJasFmicLD9MyQyCzAFo-bORHiwrGoM_kTzHIu1cJxTMH8FiABzAM4rNHTFBU7dNVcSh4lTNacMw-KHePzsmHpsS7XyhR9w

  • Once Site Collection created we can verify using Command or can check with Office 365 admin center as well. Below is the command to verify that site has been created.
Get-SpoSite -Identitiy “Your newly created Site URL”

https://lh5.googleusercontent.com/-6W0Mhm1c7weiIdCgg6A700u2gsRzVuFFTjdYEt5KuXGetqMApGygvy4jmAIQ51m4v2jY43kGUzGi8CNEHCsUtKZIa6Oj-tPIOXCv9pM-GhDtVYS6bklebE3bjUnMTsqwmw0uIVvGcldrwPnnQ

↑ Return to Top