Provision multiple SharePoint Online site collections with PnP PowerShell

This blog post follows on from my previous blog post on basic SharePoint site collection provisioning in Office 365:

In this post I will go through how you can provision multiple site collections in an Office 365 tenant using a csv file which specifies configuration information about each site collection:

  • Url
  • Site Owner
  • Template
  • Timezone
  • Title

The source code for this post is in my GitHub repo at:

The script is here:

I have included an example csv file in the repo that the script uses. It needs to be located in ‘C:\\temp’ on local machine running the script. This step could also be automated so that the csv file is downloaded from GitHub to the temp folder on the local machine, then used by the script for site collection provisioning. I use this technique in one of my other GitHub repos here at OnePlace Solutions to provision Site Columns in SharePoint. The provisioning xml is downloaded then used by the PowerShell script :


To run the SharePoint site collection provisioning script perform the following:

  • Create your csv file with all the site collection configuration information based on the example csv provided and locate it in c:\temp on your machine running the PowerShell script.
  • Run Windows PowerShell and copy and paste the following command at the command prompt:
Invoke-Expression (New-Object Net.WebClient).DownloadString(‘')
  • Enter the url of your SharePoint online tenant:


  • The site collections will be provisioned in your tenant based on the configurations provided in the csv file. To confirm progress check the Site list in the SharePoint Admin are of your tenant.

This gives you an example of how to configure all or some of the site collections in your Office 365 tenant and create them with one script. This could form the basis of any scripts you write to perform site collection provisioning.


1 thought on “Provision multiple SharePoint Online site collections with PnP PowerShell

  1. Pingback: Create a SharePoint site collection in an Office 365 Tenant with PnP PowerShell | Colin Wood

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s