Create Site Collection In SharePoint Online Using PowerShell

In my last article, I have demonstrated about how to create Site Collection in SharePoint Online Using GUI, today I am demonstrating “Create Site Collection in SharePoint Online Using PowerShell”.

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

As we know Using SharePoint Online PowerShell we can create new SPO Site, and perform another admin activity as well. 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 tasks cannot perform using UI which we can do using PowerShell easier.

  • As mentioned in my 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 user below parameter to create the New site collection in SharePoint online,
    1. New - SPOSite[-CompatibilityLevel < Int32 > ]  
    2.     [-LocaleId < UInt32 > ]  
    3.     [-NoWait] - Owner < String > [-ResourceQuota < Double > ] - StorageQuota < Int64 > [-Template < String > ]  
    4.     [-TimeZoneId < Int32 > ]  
    5.     [-Title < String > ] - Url < UrlCmdletPipeBind > [ < CommonParameters > ]  
Below are the steps to perform the above activity step by step with the screenshot:
  • 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 an initial and necessary step to get a connection established 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

    SharePoint
Once you are connected site SPO site, we can create new SharePoint Online Site collection using the 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,

 SharePoint

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”

SharePoint

I will continue in next article about how to delete SharePoint Online Site Using UI and Using PowerShell.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now