locked
[SharePoint 2007] How to run a specific custom timer job RRS feed

  • Question

  • Is there no way in SP2007 to run a custom timer job on demand?? 

    In SP2010 the timer job object has a beautiful API called RunNow() which allows me to run the job instantaneously without any schedule.

    I found this by googling

    STSADM -O RUNTIMERJOB -NAME (NAME OF TIMER JOB) -URL (SITE COLLECTION URL)

    but I was told that this is not applicable to SP 2007.

    Can you please confirm? 


    MSDNStudent Knows not much!

    • Moved by Xue-Mei Chang-MSFTModerator Monday, April 30, 2012 9:04 AM sharepoint 2007 issue (From:SharePoint 2010 - General Questions and Answers)
    Friday, April 27, 2012 8:07 PM

Answers

  • Hello!

    Please, try this solution.


    Don't happy, be worry...

    Friday, April 27, 2012 9:59 PM
  • The common way to do this in 2007 is to use STSADM to first view the current schedule, then change the schedule to some short time period (1 minute for example), wait for it to run, and then set the schedule back to the original value.

    If you know PowerShell, you can get some ideas for a script to run a job on demand here: http://www.pseale.com/blog/SharePointTimerJobs.aspx

    Don't run the script that's there! It was created to test custom timer jobs. You can extract the part of the code that changes the schedule for the job. I would add some code to save the old schedule, set the new schedule to run it ASAP, use the PS sleep command to wait until the job has had time to run, and then set the schedule back to the original value.


    Mike Smith TechTrainingNotes.blogspot.com

    Saturday, April 28, 2012 2:29 AM

All replies

  • Hello!

    Please, try this solution.


    Don't happy, be worry...

    Friday, April 27, 2012 9:59 PM
  • The common way to do this in 2007 is to use STSADM to first view the current schedule, then change the schedule to some short time period (1 minute for example), wait for it to run, and then set the schedule back to the original value.

    If you know PowerShell, you can get some ideas for a script to run a job on demand here: http://www.pseale.com/blog/SharePointTimerJobs.aspx

    Don't run the script that's there! It was created to test custom timer jobs. You can extract the part of the code that changes the schedule for the job. I would add some code to save the old schedule, set the new schedule to run it ASAP, use the PS sleep command to wait until the job has had time to run, and then set the schedule back to the original value.


    Mike Smith TechTrainingNotes.blogspot.com

    Saturday, April 28, 2012 2:29 AM