The ‘Job Queue’ feature lets you line up a sequence of multiple actions to execute on a target host. There are many different situations where you might want to execute a sequence of actions on a given host (or set of hosts). For example, maybe you want to string together multiple software deployments into a single click action. Or perhaps you want to create an update and reboot cycle that can be used to trigger your computers to run Windows Update, then reboot, then wait a few minutes, then run the update and reboot again, and so on. Or perhaps you want to have a single click action that will execute a script, then execute the update+reboot process, then execute another script. All of these examples (plus many more) are possible with the Job Queue. It’s extremely simple to operate. Here’s how it works:
- Select the host(s) that you want to include in the job queue execution, and then click on Actions > Job Queue > Create/modify job queue
- In the Job Queue window that appears you can either select a previously saved Job Queue, or you can create a new one. To select a previously saved queue, double-click the previously saved queue in the ‘Saved Queues’ grid. Or highlight the saved queue and use the ‘<<' button to load it. Once loaded, you can modify it however you like. However, if you want to create a new queue, you can simply double-click on each action you want to be included in the queue, one at a time. Or you can highlight each action one at a time, and use the '>‘ button to add that action to the queue. In the screenshot below you can see that I’ve created a simple queue that does the following:
A. Wait for host to have zero logged-on users
B. Download and install updates + reboot always
C. Wait for host to go offline and come back online
D. Wait 3 minutes
E. Download and install updates + reboot always
F. Wait for host to go offline and come back online
G. Wait 3 minutes
H. Start stopped automatic services - Now that the queue has been created, we have the option of either saving it or running it without saving it. If we just want to run it now without saving it, we can use the ‘Execute now’ button. If we want to apply the queue to the selected hosts to run later, we can use the ‘Apply queue’ button. Once a queue has been applied to a row/host, it can be executed later from the actions menu by selecting the hosts and choosing ‘Actions > Job queue > Execute job queue.’ However, we also have the option of saving the queue, which we do by adding a Queue Title and then using the ‘>>’ button to save it. Once a queue has been saved, it can be run at any time directly from the actions menu by selecting ‘Actions > Job Queue > Execute saved job queues > Title of job queue to be executed’
- That’s all there is to it. When we execute the job queue, each action that was included in the list will be executed sequentially on the host(s) selected. We could also execute a job queue from within a scheduled task, so that it’s launched on a particular date and time, even if we are not in front of the BatchPatch window at the time. Or, if you need to execute a sequence of actions/tasks that involves multiple hosts in the same sequence, please have a look at the advanced multi-row queue sequence, which allows you to coordinate a sequence of actions across multiple hosts, with dependencies such as a particular reboot/shutdown order for a given environment.