PowerShell script exchange
Post Reply
Posts: 2
Liked: never
Joined: May 06, 2011 6:44 pm
Full Name: Claude Lacombe

Start-VBRReplicaFailover with PowerShell

Post by clacombe@epsilia.com »

A client asked me to create a script to start a failover of a particular replicated VM using an icon
By surfing a little bit on the net I found a good start but I still not found how to do it.
Here are the actual script I working on!

I need to stop the original VM named xxx and then failover to the latest copy of the VM xxx to the second VMWARE Server
I appreciate any help to complete this request!

if((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null){
Add-PSSnapin "VeeamPSSnapIn"

$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes",""
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No",""
$choices = [System.Management.Automation.Host.ChoiceDescription[]]($yes,$no)
$caption = "Attention!"
$message = "Do you really want to start the failover VM for machine xxx ?"
$result = $Host.UI.PromptForChoice($caption,$message,$choices,0)
if($result -eq 0)
Write-Host "Starting the failover of the machine xxx"
(here is the place that I will add the command to do the failover
if($result -eq 1) { Write-Host "You didn't acknoledge to failover!" }
start-sleep 10
Chief Product Officer
Posts: 31089
Liked: 6464 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Start-VBRReplicaFailover with PowerShell

Post by Gostev »

Hi Claude,

You look to be our ProPartner.

Please go to the ProPartner portal, click Learning Center, click Technical papers and look for "Smart Recovery Orchestration" paper by Arseny Chernov. It seems to be leveraging similar script as a part of the process.

Hope this helps.
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests