I have a SharePoint 2010 Standard Environment. I am being asked to determine which of the 60 site collections have Analytics turned on. Is this possible with JSOM/CSOM client site?
1 Answer
you refer the link
var context = null;
var site = null;
var featureCollection;
ExecuteOrDelayUntilScriptLoaded(CheckFeatureIsEnabled, "SP.js");
function CheckFeatureIsEnabled(){
context = new SP.ClientContext.get_current();
site = context.get_site();
featureCollection = site.get_features();
context.load(featureCollection);
context.executeQueryAsync(onSuccess,onFailure);
}
function onSuccess() {
var listEnumerator = featureCollection.getEnumerator();
while (listEnumerator.moveNext()) {
if (listEnumerator.get_current().get_definitionId() == 'f6924d36-2fa8-4f0b-b16d-06b7250180fa') {
alert('SharePoint Server Publishing Infrastructure is activated on the site');
}
}
}
function onFailure(sender, args) {
alert('request failed ' + args.get_message() + 'n' + args.get_stackTrace());
}