Is there any CSOM PowerShell code to check if a site collection feature is activated or not?


There can be better and different ways to check if Feature is activated or not. But once I used below code.

Connect to your site collection using CSOM code, and load feature as below.

$FeatureID = "000-000000-0000" #GUID of your feature
$SiteFeatures = $context.Site.Features 

$IsFeatureExists = $SiteFeatures | Where {$_.DefinitionID -eq $FeatureID}

if ($IsFeatureExists)
    # Feature Exist (Activated)
    # Feature do not exist (Not Activated)

| improve this answer | |

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.