How to Use One Orchestrator Environment with Multiple SCSM Environments

System Center Orchestrator (SCORCH) is fairly powerful when it comes to automating tasks in your SCSM environment. However, one common task that eludes admins is setting up a dev environment for Orchestrator. It’s tedious to set up a new server for something as resource unintensive as SCORCH. In this blog, we’ll go over an easy method for using a single SCORCH environment to easily handle multiple SCSM environments.

Note: We are assuming that:

  1. You have an SCSM development environment already set up.
  2. Your runbooks are calling .NET scripts, probably with SMLETS (but not required) instead of using native Orchestrator runbook activities.

First, I’ll start with my runbook structure. Originally, I have something like this:

Orchestrator

Next, I’ll create a new folder for dev.

SCORCH 2

I could then export and import all of our runbooks into my dev folder. But instead, I’d rather create (or copy) new dev runbooks one at a time since I can mostly only test one at a time. For now, I’ll copy over User Management > Create New Employee.

SCORCH 3

Now that the new runbook is created, let’s take a look at editing both the .NET script runbook activity, as well as the actual PowerShell. Opening up the .NET script, we see this:

SCORCH 4

This leaves very little room for determining if this runbook is running against dev or prod. Let’s open up our script and take a look at our parameters.

SCORCH 5

I’ll have to do some edits to this script. But it’s only sometimes a good idea to dev in prod. So I’ll make a copy of the script.

SCORCH 6

In my newly-copied dev script, it only prompts for one parameter, the SCSM runbook activity’s ID. I’ll need to add another parameter for the SCSM server. That way, when SCORCH starts this runbook it will always point to our dev SCSM environment.

SCORCH 7

As noted above, after I added the $scsmServer parameter, I then:

  1. imported SMLETS, which sets the smdefaultcomputer variable to the SCSM management server, probably production.
  2. reassigned smdefaultcomputer to the parameterized SCSM server. This must occur after importing smlets.

After my script is updated, I still have to update the SCORCH runbook to use this updated path and parameter.

SCORCH 8

Next, I can check in this runbook, run my dev SCSM’s SCORCH connector to pull in this runbook, and then update my SCSM Library > Template > RBA Template > Runbook to use the correct dev runbook.

After I confirm that this is correct, I can then copy the

C:\RunbooksDev\Runbook_CreateNewEmployee.ps1 script back into the production

C:\Runbooks\folder, and update the prod SCORCH runbook to point to the production server.

You can pick up additional tips and tricks in the Cireson Community and during our Community Open Floor meetups.

Experience Teams Ticketing Today

Start your 14-day free trial of Tikit. No credit card required.