Skip to main content
Question

Failover plan script parameters

  • March 12, 2026
  • 5 comments
  • 30 views

I am creating failover plans in VBR and want to script changing DNS entries to point to new IPs.  I can’t find any documentation about how these scripts run, any parameters that can be passed to them etc.  All I can see is that they run on the VBR server.  Can anyone point me to something?

Thanks

5 comments

Chris.Childerhose
Forum|alt.badge.img+21

  • Author
  • New Here
  • March 12, 2026

That one is for backup jobs and doesn’t seem to provide any useful info unfortunately.  Is there anything specific for Failover plan scripts, or any example scripts anyone can link to?  Ideally want to be able to pull the vm names into script so I can change the DNS entries for each.  I have the static powershell script sorted but wanted to make it more flexible.


Jason Orchard-ingram micro
Forum|alt.badge.img+1

That one is for backup jobs and doesn’t seem to provide any useful info unfortunately.  Is there anything specific for Failover plan scripts, or any example scripts anyone can link to?  Ideally want to be able to pull the vm names into script so I can change the DNS entries for each.  I have the static powershell script sorted but wanted to make it more flexible.



DNS updates that would depend on what type of dns server your running. each server will have unique command set to allow dynamic updates. 
 

 

 


coolsport00
Forum|alt.badge.img+21
  • Veeam Legend
  • March 13, 2026

Hi ​@socandyo - Welcome to the Community!

Yeah..I agree with ​@Jason Orchard-ingram micro on this. Coming up with a Script for your particular niche use-case would be dependent upon what you’re using. That said, hopefully someone can provide something based on what you’re using. And, how they run...well...Chris shared the area in the Guide on how to place/run them. Hope it helps ​@socandyo 👍🏻


eblack
Forum|alt.badge.img
  • Experienced User
  • March 13, 2026

For DNS updates specifically, the way to handle it is to make the script self sufficient using the Veeam PowerShell module. The script runs on the VBR server so it has access to the Veeam environment. You query replica state directly to find what is currently in failover, then pull the Re-IP rules from the replication job to get the production to DR IP mappings, then drive your DNS updates from that data.

A few things worth knowing. Re-IP rules only exist for Windows VMs so Linux replicas will need a static mapping table in the script. The Veeam service account needs DNS admin rights or you remote into a DC with Invoke-Command. If your DR DNS is a separate server from production, target it explicitly with the ComputerName parameter on the DNS cmdlets.

If you need dynamic parameter passing between plan steps, that is what Veeam Recovery Orchestrator is built for. VBR failover plan scripts are intentionally basic.

Something like this as a starting point:

Import-Module Veeam.Backup.PowerShell

$failedOverReplicas = Get-VBRReplica | Where-Object { $_.State -eq "Failover" }

$job = Get-VBRJob -Name "YourReplicationJobName"
$reipRules = $job.GetViReplicaOptions().ReIpRules

foreach ($replica in $failedOverReplicas) {
# match replica to reip rule, get target IP, then update DNS
Remove-DnsServerResourceRecord -ZoneName "yourdomain.com" -Name $replica.Name -RRType A -Force
Add-DnsServerResourceRecord -ZoneName "yourdomain.com" -A -Name $replica.Name -IPv4Address $targetIP
}

There’s some information on the R&D forums but I’d agree it’s somewhat sparse on this specific topic.