In SharePoint 2013, we have a new site template called Developer Site Template. It is a site template, which is used extensively for an app development and you can only deploy apps for SharePoint to a Developer Site.
I have a scenario, where I need to enable the developer Site Collection feature for an existing Site Collection. It may be a team site or publishing site. There isn't a button in Site Collection features to allow you to enable this.
If you were using SharePoint 2013 On-Premises, you’d just run Enable-SPFeature given below.
I have a scenario, where I need to enable the developer Site Collection feature for an existing Site Collection. It may be a team site or publishing site. There isn't a button in Site Collection features to allow you to enable this.
If you were using SharePoint 2013 On-Premises, you’d just run Enable-SPFeature given below.
- Enable-SPFeature e374875e-06b6-11e0-b0fa-57f5dfd72085 –url http://gowthamr.sharepoint.com
With SharePoint Online, we can't do this directly, so I have created a simple method to solve this. We can run this script in our Internet Browser console.
We have already seen how to activate the developer site feature, using JSOM. Now, we are going to use CSOM method.
We have already seen how to activate the developer site feature, using JSOM. Now, we are going to use CSOM method.
- FeatureDefinitionScope Enumeration.
- public enum FeatureDefinitionScope.
Member name description
None- The feature scope is not specified. The value = 0.
Farm Enumeration, whose values specify that the feature scope has to be at the Farm level. The value = 1.
Site Enumeration, whose values specify that the feature scope has to be at the Site Collection level. The value = 2.
Source code
None- The feature scope is not specified. The value = 0.
Farm Enumeration, whose values specify that the feature scope has to be at the Farm level. The value = 1.
Site Enumeration, whose values specify that the feature scope has to be at the Site Collection level. The value = 2.
Source code
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Microsoft.SharePoint.Client;
- namespace O365SPAddUsertoRole
- {
- class Program
- {
- private class Configuration
- {
- public static string ServiceSiteUrl = "https:// https://gowthamr.sharepoint.com";
- public static string ServiceUserName = "[email protected]";
- public static string ServicePassword = "xxxxxxxxxx";
- }
- static ClientContext GetonlineContext()
- {
- var securePassword = new SecureString();
- foreach (char c in Configuration.ServicePassword)
- {
- securePassword.AppendChar(c);
- }
- var onlineCredentials = new SharePointOnlineCredentials(Configuration.ServiceUserName, securePassword);
- var context = new ClientContext(Configuration.ServiceSiteUrl);
- context.Credentials = onlineCredentials;
- return context;
- }
- static void Main(string[] args)
- {
- var context=GetonlineContext();
- Web web = context.Web;
- var featureId = new Guid("e374875e-06b6-11e0-b0fa-57f5dfd72085");
- var features = context.Web.Features;
- features.Add(featureId, true, FeatureDefinitionScope.None);
- context.ExecuteQuery();
- }
- }
- }
Was my blog helpful?
If so, please let us know at the bottom of this page. If not, let me know what was confusing or missing and I’ll use your feedback to double-check the facts, add info and update this blog.
If so, please let us know at the bottom of this page. If not, let me know what was confusing or missing and I’ll use your feedback to double-check the facts, add info and update this blog.

Mad DiahPosted Oct 5, 2017, 6:05 AM
Hi there.. I successful Enabling The Developer Site Collection. But from my observation, there are couple of additional items added after enabled the features for e.g Quick Link (New link added like Developer Center & Sample) and then the default page will be default to DevHome.aspx. After I Disable the Feature, the additional items is still there? What should do remove the additional items from been created? I'm using Sharepoint Online.
Pradeep RNPosted Apr 5, 2017, 7:01 AM
HI Gowtham good share, but how do we get to know the Id for the developer feature