Imagine you have a PowerShell script that you want to run as part of failover or restore. You can upload your script into VAO, and it will be automatically executed when you run your plan.
The script can execute on a Veeam Backup & Replication 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 VAO UI, and in Plan Execution and DataLab Test reports.
This section will demonstrate how to upload a simple example script into VAO.
$fileName = "HelloWorld.txt"
"Hello World!" | Out-File -FilePath "$folderName\$fileName"
Write-Host "File $fileName was created in folder $folderName"
Write-Error "Failed to create file in folder $folderName"
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 are willing to use must be a PowerShell script. VAO 2.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 the Veeam Backup & Replication server, no additional software is required.
In This Section
- Creating Custom Script Step in VAO
- Configuring Common Parameters
- Configuring Windows Credentials Parameter in VAO UI
- Adding Credentials Parameter to Your Script
- Adding Custom Parameters
- Using Runtime Parameter Variables
- Capturing Script Errors and Warnings
- Adding Custom Script Step to Plan