Debugging Powershell Scripts for Orchestrator 2012

Let me start by saying I love Powershell.  It’s a extremely powerful and strangely fun language to code with that can make virtually any aspect of my day faster and easier.  Along those same lines I love Orchestrator, because it can take those tasks and automate them.  You can even integrate your runbooks with something like Service Manager Self Service Portal to offer delegation of your automated tasks to other users so you don’t spend your day running reports off of scripts you wrote or some other tedious task.

With all of that being said, writing Powershell scripts that work as expected with Orchestrator can be a pain, unless you’re running a 32-bit Windows 7 machine, more on that later.

Continue reading

Automating Orchestrator 2012 Runbooks with Scheduled Tasks

I was recently faced with the challenge of having some Orchestrator 2012 runbooks fire off on a schedule, mainly for custom Active Directory reports that other teams want to receive on a regular basis.  Since the days of doing such tedious tasks manually are (thankfully) long gone, I decided to use Orchestrator to automate the creation and distribution of these reports.

The Problem

While it’s a fairly well known fact that Orchestrator has this ability built in via the Monitor Date/Time Activity, I have a hard time stomaching the fact that the runbook has to be running all the time just for its five minutes per week to be useful.  So naturally you think about scheduled tasks, but they you have to write a Powershell script for every runbook you want to automate, then create a corresponding Scheduled Task, label it something useful, set it up, test it, and so on.  I also considered launching all periodic runbooks from a master scheduler runbook, which wasn’t a bad idea, but everytime I wanted to add another report, I would have to rework this master runbook which would eventually swell to a Krakken-esque monster of lines, activities, data passing, and other headaches.

Continue reading