Powershell script to backup VMs under vApp

PowerShell script exchange

Powershell script to backup VMs under vApp

Veeam Logoby slimer » Fri Jul 11, 2014 11:19 pm

Hi,

I would like to seek advise how to backup VMs under vApp or what command should I use to call all the VMs under vApp and get the script create a backup job automatically. I'm able to add the vApp using Gui, but i need to automate the creation of backup job using script.

Thank you. :)
slimer
Novice
 
Posts: 7
Liked: never
Joined: Thu Nov 07, 2013 3:47 am
Full Name: Emil Juanillo

Re: Powershell script to backup VMs under vApp

Veeam Logoby slimer » Sat Jul 12, 2014 6:32 am

Hi to All,

Just to make it simple, is there a way to get the VMs name under VirtualApplication group in a Folder?
Currently i'm using this script but not showing VMs under VApp.
Find-VBRObject -Server $VBRserverVC | ?{$_.VMFolder -eq "group-vxxx"} | Select Name

Thank you.
slimer
Novice
 
Posts: 7
Liked: never
Joined: Thu Nov 07, 2013 3:47 am
Full Name: Emil Juanillo

Re: Powershell script to backup VMs under vApp

Veeam Logoby tsightler » Sun Jul 13, 2014 1:56 am

As it says when you run it, Find-VBRObject is obsolete and has been for some time. Instead you should be using Find-VBRViEntity which is capable of finding vCenter objects including vApps which you can then add to the job with Add-VBRViJobObject something like this:

Code: Select all
Find-VBRViEntity -Name "<vApp_Name>" | Add-VBRViJobObject -Job "<Job_Name>"

If however, you'd rather just add the VMs from the vApp to the job as individual VMs you could do something like:

Code: Select all
$vapp = Find-VBRViEntity -Name "<vApp_Name>"
Find-VBRViEntity | ?{$_.Path -like ($vapp.Path + "\*")} | Add-VBRViJobObject -Job "<Job_Name>"
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Powershell script to backup VMs under vApp

Veeam Logoby slimer » Mon Jul 14, 2014 11:06 pm

Thanks Tom, I will try this one.
slimer
Novice
 
Posts: 7
Liked: never
Joined: Thu Nov 07, 2013 3:47 am
Full Name: Emil Juanillo


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests