Feature Exists (Activated on SPSite)

Method to iterate through SharePoint SPSite collection to check to 
see if a feature (featureGuid) exists. If found, method returns true.

 

 

private bool FeatureExists(SPSite siteCollection, Guid featureGuid) { 

bool found = false; 

foreach (SPFeature feature in siteCollection.Features) { 

if (feature.DefinitionId == featureGuid) {
found =
true; 

break;

}

}

 

return found;

}

 

Cool eh?

Author

David

comments powered by Disqus

Categories

Recent Tweets

"Setting up and Getting Started with Power BI Embedded | Data Exposed" channel9.msdn.com/Shows/Data-Exp… #webcast #feedly
Retweeted by @dyardy @scottgu @victoriabeckham Worlds collide, double take on that photo!
@scottgu @victoriabeckham Worlds collide, double take on that photo!
@projectedxyz It is really easy, what are you doing (isn't this data which on the web)