We are going to build a medium farm and would like to split the timer jobs across the CA and WFE server.

How do I set which timer job runs on which server?

  • 1
    Note: In central admin -> Application Management -> Manage content databases -> Click content database -> at very bottom of this “content database settings” page, you set "Preferred Server for Timer Jobs". However as Benjamin J Athawes mentioned below this is only a preferred server and the server on which the timer job runs is tied into services running on the server. – reva Dec 13 '12 at 23:02
  • Also Check simple-talk.com/dotnet/.net-tools/… -> Section "Which Server Does the Timer Job Run On" – reva Dec 24 '12 at 16:16

Are you referring to out of the box or custom timer jobs?

You can use the "Timer Job Status" page within Central Administration to view scheduled and running jobs - the "Server" column shows you where the job is being run.

I am not aware of a means of directly changing where a timer job will run. However, it's worth noting that the location is likely tied to the services that are running on each server. For example, stopping the "Web Analytics Data Processing Service" on a server will have a knock on effect on the corresponding timer jobs that are run. A timer job acts as a trigger to start a specific Windows service.

For development purposes, the SPJobDefinition.LockType Property determines whether the job runs on one server only or on all servers in a farm. I would not recommend using this approach to modify the OOB timer jobs as I'm not sure that it's supported.

| improve this answer | |

TimerJobs can take an SPServer as constructor parameter. I've seen this but never used it before, so no idea if it'll work. Using SPJobDefinition.LockType.Job locks it on 1 specific machine, but you'll have no guarantee which one that'll be.

| improve this answer | |

We can use the manage the Timer job as below

protected SPJobDefinition(
    string name,
    SPService service,
    SPServer server,
    SPJobLockType lockType
 and this we can call from feature receiver and we can set all the parameter 

public override void FeatureActivated(SPFeatureReceiverProperties properties)
        SPServerCollection servers = SPFarm.Local.Servers;

          SPServer myServer = servers["myExistingServer"];
          myServer.Name = "NewServerName";
          myServer.Role = SPServerRole.Application;
          TimerJob timerJob = new TimerJob("JobName", SPService,myServer ,SPJobLockType.Job );
            SPDailySchedule schedule = new SPDailySchedule();
            schedule.BeginHour = 3;
            schedule.BeginMinute = 0;
            schedule.EndMinute = 30;
            schedule.EndHour = 3;
            timerJob.Schedule = schedule ;

| improve this answer | |
  • Does this worked for anyone? Why do we need to set myServer.Name and myServer.Role? – Nikhil Chavan May 6 '16 at 9:18

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.