How to Properly Automate the Service Manager Orchestrator Connector

Author by Christopher Mank

If you've worked with Service Manager and Orchestrator for any length of time, you will soon discover that most of the time, the out-of-box Service Manager Orchestrator Connector does not bring over new Runbooks.  There are many posts on the web (like this post) that explain the issue and show you a quick SQL command you can run to fix the issue before running your connector sync. Since I am of the "Automate it!" philosophy, I wanted to put together a process that would run this command and sync the connector for me automatically.  So, to properly automate the Service Manager Orchestrator Connector, just follow these simple instructions. Runbook Sync Orch RB Image Monitor Date/Time This one is pretty straightforward.  Configure the automation to run at a time that is most convenient for your environment.  I would recommend a time when Orchestrator utilization is at its lowest. Check Schedule Anytime I create a monitor Runbook, I like to pair it with its own Schedule.  This gives you the flexibility down the road to manage the schedule independently from other processes. Check Schedule Link Make sure you configure the link between Check Schedule and Query Database to look like what's pictured below.  This tells the Runbook to only proceed if it complies with your given schedule. RB Check Schedule Image Query Database This activity will run the TRUNCATE TABLE command mentioned in the above post.  It will clear the Authorization Cache in Orchestrator to grant the Connector Run As account access to all Runbooks. Query DB 1 Image Query DB 2 Image Sync Orchestrator Connector (Run .Net Script Activity) This script will load the SCSM CMDLets, get the Orchestrator Connector and start it.   Start Orchestrator Connector Image $SMModule:  You will notice this variable is pointing to a file path locally on the Runbook server.  This location needs to contain the following two things. 1.  The entire PowerShell folder found in C:Program FilesMicrosoft System Center 2012Service Manager on the SCSM Management Server. 2.  All of the DLLs that start with "Microsoft.EnterpriseManagement" found in C:Program FilesMicrosoft System Center 2012Service Manager on the SCSM Management Server.  You probably don't need ALL of those DLLs, but since different CMDLets call different DLLs, and instead of tracking them down one by one, I just copy them all.  The folder structure should like the below screenshot. SCSM PowerShell Module Files Image $SMServer:  This is your primary Management Server name that runs your Connectors and Workflows.  If you have multiple Management Servers, the one that runs your Connectors and Workflows is the first one you installed. $Conn:  You will notice the Get-SCSMConnector is piping the results to a WHERE clause to find the correct connector (DisplayName -like 'OR_*).  You will need to change this to match the name of your Orchestrator connector in Service Manager. That's all there is to it!  Schedule this to run once a day like the out-of-box connector and/or run on demand when you are syncing over some new Runbooks to SCSM.  I hope this helps. Until the Whole World Hears, Christopher

Author

Christopher Mank

Systems Architect