One of the other simpler option that i found is to use the stsadm extensions created by Gary Laponite - http://stsadm.blogspot.com/. These extensions provide lot of options on the command line. Here lets see how to use the stsadm command line extensions for updating timer job schedule. These extensions have a prefix "gl" to the normal stsadm operations.
1) Get information of a timer job:
stsadm -o gl-getjobinfo -job "Timer Job" -URL
This command gives the details of the timer job like Timer schedule, type, next occurrence, when the job last ran etc
2) Set the schedule for specified job:
This has many options. We can set the timer job schedule as a Minute/Daily/Monthly/Daily schedule.
Parameters:
-job
-url
-scheduletype
For a daily schedule:
-beginhour
-beginminute
-beginsecond
-endhour
-endminute
-endsecond
For a minute schedule:
-beginsecond
-endsecond
-interval
For a monthly schedule:
-beginday
-beginhour
-beginminute
-beginsecond
-endday
-endhour
-endminute
-endsecond
For a one time schedule
-time
Ex:
stsadm -o gl-setjobschedule -job "Timer Job" -URL
Running the above command sets the timer to run the job daily at 1:30 PM
This way we can reschedule the timer job
Thanks to Gary Laponite for these wonderful commands. Check out the other stsadm extensions @ http://stsadm.blogspot.com
http://blog.falchionconsulting.com/index.php/stsadmpowershell-commands/
No comments:
Post a Comment