Help Center
Choose product document...
Veeam Availability Orchestrator 1.0
User Guide

Script Example

Imagine you have a PowerShell script that you want to run as part of failover. You can upload your script into VAO, and it will be automatically executed when you run your failover plan.

The script can execute on the Veeam Backup & Replication server or inside each VM, and you can pass parameters into the script including credentials, runtime variables (such as vm_name or plan_state), and any custom parameters you require. Script output will be captured in plan details in the VAO UI, and in Plan Execution and Plan Test Execution reports.

The following sections will demonstrate how to upload the simple example script below into VAO.

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

}

Veeam Large Logo

User Guide

Deployment Guide

Categorization Guide

RESTful API Reference