I have deployed a solution with farm scope feature.

I am able to activate / deactivate feature via "Manage Farm feature".

I want to do this via power shell :

When i try to activate feature "Enable-SPFeature -Identity *14hive_featurefoldername* though this command exception is thrown:

Enable-SPFeature : Object reference not set to an instance of an object.

Whereas Disable-SPFeature feature work properly.

What am i missing in Enable-SPFeature statement?

2 Answers 2


It seems the code in SPFeatureReceiver.FeatureActivated method is throwing this exception. Please check and correct the code in your Feature Receiver class.

  • 1
    I also think this is the case. Check the ULS log, it definitely will contain the exception. Commented Nov 2, 2011 at 19:24

Did you try to identify the feature by its id (guid). this worked perfectly for me.

Enable-SPFeature -Identity [Guid]

If you don't know the Identity of the feature have a look at the properties in Visual Studio or use SP Manager 2010

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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