This is an archive version of the document. To get the most up-to-date information, see the current version.

Adding Custom Scripts to Veeam Disaster Recovery Orchestrator

Imagine you have a PowerShell script that you want to run as part of the recovery process. You can upload your script into Orchestrator, and it will be executed when you run your plan.

The script can run on a Veeam Backup & Replication server, on the Orchestrator server or inside each VM included in the plan. You can customize settings required for script execution and pass various parameters into the script: credentials, runtime variables (such as vm_name or plan_state) and any other custom parameters you require. Script output will be captured in plan details in the Orchestrator UI, and in Plan Execution and DataLab Test reports.

This section will demonstrate how to upload a simple example script into Orchestrator.

Param(

   [Parameter(Mandatory=$true)]

   [string]$folderName

)

 

try {    

   $fileName = "HelloWorld.txt"

   "Hello World!" | Out-File -FilePath "$folderName\$fileName"

   Write-Host "File $fileName was created in folder $folderName"

}

catch {

   Write-Error "Failed to create file in folder $folderName"

   Write-Error $_.Exception.Message

}

Requirements

If you want to create a custom script and execute it when running an orchestration plan, you must take into account the following considerations.

  • The script you want to use must be a PowerShell script. Orchestrator 5.0 supports PowerShell scripts only.
  • To allow the script to run inside a VM guest OS, it is required that you have Microsoft PowerShell 3.0 and .Net Framework 4.0 installed on each VM for which you enable the custom script step.
  • To allow the script to run on a Veeam Backup & Replication server, no additional software is required.

In This Section