In this blog post, I will share with you how I automated the Orchestrator database maintenance activity using a PowerShell script. This script can help you optimize the performance and reliability of your Orchestrator environment by cleaning up the database from old and unused data.

You can find the Script in this GitHub repository:

Please note that this script is only compatible with the legacy web console of Orchestrator and does not work with the new API introduced in System Center Orchestrator 2019. The script supports the following versions of Orchestrator:

  • System Center Orchestrator 2012
  • System Center Orchestrator 2012 SP1
  • System Center Orchestrator 2012 R2
  • System Center Orchestrator 2016
  • System Center Orchestrator 2019 RTM (with old web console)

If you are using SCO2019, SCO2022 or the new API, you can use a different script that I have created for those scenarios. You can find it here:

https://github.com/somahato/Codes/blob/SCORCH/DatabaseMaitenanceScript_2022.ps1

The above Script is intended to perform the steps mentioned in the following article. Additionally, this Script will start the Runbooks which will be stopped during the execution process.