Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually start SharePoint timer job

I'd like to invoke a timer job installed on a SharePoint server manually. What would be useful is something along the lines of an stsadm command.

My scenario is, I've deployed a solution with a bunch of features to a customers server. I don't want to wait for the weekly schedule to kick a particular timer job to life. I would like to just punch in a command to get the specific job to run immediately. Obviously in the development enviroment I've got the schedule set for a few minutes but I want to do a test run while I'm on site with the customer.

like image 453
Daniel Revell Avatar asked Jul 16 '09 14:07

Daniel Revell


1 Answers

You can develop a custom command line based tool that gets the job's SPJobDefiniton based on the criteria that identifies your job from the service.JobDefinitions collection. From there you can execute it using the Execute() method.

like image 61
Magnus Johansson Avatar answered Oct 03 '22 19:10

Magnus Johansson