[SharePoint 2007] How to run a specific custom timer job
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!
April 27th, 2012 4:07pm
Hello! Please, try this solution.Don't happy, be worry...
April 27th, 2012 5:59pm
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
April 27th, 2012 10:29pm