Activate or deactivate timer job feature using PowerShell

Scenario:

  • You want to activate your newly deployed feature to install a timer job
  • You want to deactivate the feature and remove the job
  • You want to deploy an update to the existing timer job feature
Message:
The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Note:
I was able to Deactivate the feature from the SharePoint UI, as a farm admin, but the Activate still failed for me.

Solution:
Use the following PowerShell commands:

 Disable-SPFeature -Identity "TimerJobName" -url http://site:port  
or
 Enable-SPFeature -Identity "TimerJobName" -url http://site:port  

To determine your feature's name you can use (which can be tricky sometimes) use this command:
 Get-SPFeature | where-object {$_.DisplayName -match "MyPattern"} | Select DisplayName  

2 comments to Activate or deactivate timer job feature using PowerShell

  • Anonymous

    what will be the root of command prompt??

  • Please note that this is not the regular windows command prompt but the SharePoint PowerShell command prompt (Start button - All Programs - Microsoft Sharepoint 2010 Products - SharePoint 2010 Management Shell). The "root" is not relevant in this case. I hope this helps.

Leave a Reply