PowerShell script exchange
Post Reply
sandsturm
Veteran
Posts: 290
Liked: 25 times
Joined: Mar 23, 2015 8:30 am
Contact:

Get all VMs of a Storage Snapshot backupjob

Post by sandsturm »

Hi

Some of our backupjobs are configure to schedule a storage snapshot only. (Standard virtual machine backup job with Backup repository: "ONTAP snaphot" in case of Netapp storage systems).
I want to get a list of VMs, which are processed by such a storage snapshot only backupjob, but wasn't able to get to this data and couldn't find the answer by searching the internet. Does anyone have a codesnippet with an example?

thx and regards,
sandsturm
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get all VMs of a Storage Snapshot backupjob

Post by oleg.feoktistov » 1 person likes this post

Hi,

If the goal is to get the list of already processed vms, that is backup objects, in a snapshot, there is no supported way to do this.
The workaround with .NET methods would be the following:

Code: Select all

$backups = [Veeam.Backup.Core.CBackup]::GetAll() | where {$_.JobTargetType -eq "SanSnapshot"}
foreach ($backup in $backups) {
  $objectNames = $backup.GetObjects().DisplayName
  $backup | select Id, Name, @{n='Objects';e={$objectNames}}
}
Best regards,
Oleg
sandsturm
Veteran
Posts: 290
Liked: 25 times
Joined: Mar 23, 2015 8:30 am
Contact:

Re: Get all VMs of a Storage Snapshot backupjob

Post by sandsturm »

Hi Oleg

Thanks a lot, I'll try that.

regards,
sandsturm
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 6 guests