Saturday, April 5, 2014

There were two different questions on the front page of Server Fault today, both needing a way to deploy scheduled tasks to a large number of servers. The preferred method for this type of thing is to use System Center Orchestrator, but if you don't have System Center licensing, you can deploy scheduled tasks using GPO.

First, open the Group Policy Management Console. You can find the policy preferences that we care about in Computer Configuration > Control Panel Settings > Scheduled Tasks.

Right click on Scheduled Tasks and select "Scheduled Task (At Least Windows 7)" if you're targeting this at Window 7 or 2008 R2 or later.

You're now presented with the familiar Task Scheduler dialog. Here you can configure the task like you would on any individual computer.

You should now have a Scheduled Task item. The default action is "Update" but "Create" or "Replace" will have similar results. For a quick rundown of what the actions do, read this TechNet article.

If we hop over to one of the servers that this policy applies to and run a gpupdate /force, we can then go into Task Scheduler on the local computer and see the job that we defined in GPO.

Hopefully, this makes the deployment and management of scheduled tasks a bit easier if you don't have a proper workflow management system like System Center Orchestrator. Happy scheduling!

I purposely do not name my employer here and any reference to it is stripped from scripts/code before it is posted. This blog and all related links and profiles are entirely my own. My opinions, beliefs, rants, etc are completely mine and are not indicative of the beliefs of my employer.