3

I have an already developed timer job that is running on front end servers, but I want to set it to run on application servers only.

Can I do this with PowerShell without modifying any code of the timer job?

3

The solution posted by Benny Doesnt work. Enable disable atimer job with powershell enables/disables on all servers regardless of which server you execute the powershell commands.

The only way to do this is with development in the jobconstructor specify the server you want the job to run, maybe by reading it from the FARM property bag.

2

Here's an example of how to create a new Timer Job for a specific server. Check out the very last code block. It does require a new constructor for your Timer Job that accepts a servername as a parameter.

http://maraboustork.co.uk/2010/10/using-powershell-to-set-up-an-sptimerjob/

1

If you have globally deployed your solution, it should be possible. Start by disable the timer job on the WFE:

Get-SPTimerJob custom-timer-job | Disable-SPTimerJob

Then, enable the same timer job on your application server:

Get-SPTimerJob custom-timer-job | Enable-SPTimerJob

To learn more on how to manage timer jobs in SharePoint, read the article Use Windows PowerShell cmdlets to manage timer jobs in SharePoint 2013.

  • 1
    this enables/disables in all servers. – Luis Valencia Aug 8 '13 at 10:10

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.