Provision site collection using webtemplate in office 365
using Powershell+CSOM


Posted on September 6th, 2014

In this post you will learn how to provision site collection using custom webtemplate in office 365 using Powershell + CSOM.

For this one, first you need to get list of webtemplates available within site collection and then apply webtemplate later to the site collection.

If you are developing webtemplate for first time, check this video on how to develop webtemplates in SharePoint 2013 online.

Prerequisites:

Create site collection in office 365 using select template later option. In this example i have created one. After creating the site collection with select template later option, when you open the site collection it show below options.

From the above figure click on solution gallery and upload your webtemplate solution and activate it.

For executing the script below are the list of dlls we need.

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

Powershell script:

Step 1: Get list of available webtemplates:

The below script helps to identify list of webtemplates available within the site collection.

From the output of the above script you have to identify the name of your webtemplate. See the below screen.

Step 2: Provision site collection using webtemplate:

Once you have webtemplate details, you can apply that to create a create site collection.

See below script for provisioning site collection using webtemplate.

Conclusion:

In this post you have learned how to provision site collection using webtemplate in office 365 using Powershell + CSOM.


› Provision site collection using webtemplate in office 365 using Powershell + CSOM

About Author

Devendra Velegandla is a four-time recipient of Microsoft's Most Valuable Professional (MVP) award (2014-2017) for Office Servers and Services MVP and  SharePoint Server.He received the MCC award for his contributions in Microsoft MSDN/TechNet forums.He loves sharing articles, videos and tutorial on SharePoint and Office 365.


If you found this post helpful, please share with your friends!!


Join 5,500 subscribers and receive instant access to

Devendra's Library of Resources for SharePoint Developers