SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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

share|improve this answer
I also think this is the case. Check the ULS log, it definitely will contain the exception. – Anita Boerboom Nov 2 '11 at 19:24

In my case I changed the scope from Web to Site in my Elements.xml of the feature. After I changed the scope back to Web, the Enable-SPFeature cmdlet worked perfect.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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