Is it possible to Activate Site Feature - SharePoint Server Publishing in the O365 environment using workflow, a web service or a combination of workflow/web service or any other way?

We have a parent site with many project sub sites that are automatically created from a custom site template as projects are registered at the parent Site level. These project sub sites are created by the Nintex workflow which uses the action Office 365 reate site. It would seem that it would be standard for someone to want to automate the Activation of SharePoint Server Publishing feature without involving a human administrator to perform this functionality on hundreds, and maybe 1 or 2 thousand of sub sites.

I have done some reading/research but I don't have a clear answer for this requirement in the O365 context.

Firstly is it possible to do? If so, how can one go about implementing this solution.


I have used the below code to activate features with the help of CSOM. You can also try and use it, though I am not sure about its feasibility with office 365 but I'll try this and will update this answer.

function ActivateFeature(featureGuid)
var clientContext = new SP.ClientContext.get_current();
var site = clientContext.get_site();
var guid = new SP.Guid('{'+featureGuid+'}');

var featDef = site.get_features().add(guid, false, SP.FeatureDefinitionScope.site);

clientContext.executeQueryAsync(Function.createDelegate(this, this.OnSuccess), Function.createDelegate(this, this.OnFail));

function OnSuccess(sender, args) {

function OnFail(sender, args) {
    alert('Fail: ' + args.get_message() + '\n' + args.get_stackTrace());

Feature ID of Publishing feature: "94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb"


  • Is it achievable through REST API? – Arun Jun 20 '17 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.