Alright I give. I've tried to make sense of the documentation and example for creating a new backup job but either I'm missing something or there is an element missing from the cmdlet. How do you specify which ESX server to connect to for backup? Whenever I try to setup a job, it tries to connect to an ESX server that is currently offline.
What I want to do is create a backup job that will go through all VMS in the store, DataStore2 from the server called ESX and back them up locally to G:\datastore2. This is the most recent version of my expression, which fails.
Add-VBRBackupJob -Name "Dstore2_Backup" -Type VDDK -mode san -Folder g:\datastore2 -objects DataStore2 -host "My Computer" -FileName g:\dstore2.vbk
I'm suspecting I have to set the right value for -objects but I'm not sure how.
You cannot choose a datastore as a container to backup VMs from. This feature will be delivered with v5. I'm not a great PowerShell expert, but I would recommend you to try using the following syntax. That should allow you to choose every VM located on the ESX.SERVER.LOCAL host:
Add-VBRBackupJob -Name "Dstore2_Backup" -Type VDDK -mode san -Folder g:\datastore2 -objects ESX.SERVER.LOCAL -host "My Computer" -FileName g:\dstore2.vbk
Additionally, please have a look at this topic which contains some useful information about using PowerShell. There you will also find a link to the script example created by one of our customers, which he posted in his blog - Powershell cmdlets
I ended up removing my offline VM from the list. It didn't have any backups yet so it wasn't a big deal. Once that was done I was able to get the command to work. Allthough I also realized I was specifying the folder name and not the actual VM name for -object. But even so, it seems you need to be able to specify a server name because what happens if you happen to have VMs on different hosts that happen to have the same name?
Using PowerCLI and Veeam, I created my job like this: