Sivarajan's Blog

SharePoint | Office 365 | Azure | JavaScript

How to automate the Content Types provision in SharePoint Online using Client Object Model – Part 2

This post is a continuation of the previous post. We have discussed that how to automate the Site Columns creation using Client Object Model. Now we will see that how to automate the Content Types creation.

1. Download and open the “SiteProvising” solution.

2. Once you create the site columns as I mentioned in part 1, we are ready to create the content type.

3. Right click the “Contoso.IntranetAssets” project and add the new folder “Content Types”.

4. Right click the “Content Types” folder and add the new item “Content Type” and name it as “Employee” and leave the base content type as “Item”.

5. Now select the site columns “Employee Name”, “Employee Age” and “Employee Address”.


6. Now run the “SiteProvisioning” project and select the option “Content Types”.

7. All the site columns will be created in the associated site collection.


Here is a source code for Content Type automation.



You can create the multiple content types under the folder “Content Types”. The above code will collect all the content types’ elements files and provision in the associated site collection.

I have detailed blog here why I choose this approach.

Comments (1) -

  • Balaji

    12/3/2015 10:48:52 PM | Reply

    I'm not able to download the source code. Can you please share the exact link to download the code

Add comment