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
- 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:
- 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”