Tuesday 23 January 2018

Create Site Collection in SharePoint Online Using PowerShell

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 task 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 in 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 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 above activity step by step with 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 like below screen shot also,

  • Once you are connected site SPO site, we can created 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 from 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”


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

No comments:

Post a Comment