Manually start SharePoint timer job

末鹿安然 提交于 2019-12-22 06:40:34

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/1137985/manually-start-sharepoint-timer-job

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!