Is there a way to get a list of backed up VMs from a job that is targeting a group of VM tags or I have to get a list of tags for each job and run another powercli script against VC to get a list of VMs for each of the TAG combination I get from each job configuration?
Oleg recommended making a restAPI call against disks -> post510752.html#p510752
This would not work in one of my environments where they aren't ready to move to Enterprise Plus.
Is what I suggested above the only option I have for Veeam Enterprise?
Code: Select all
# Define CSV file path
$csvFilePath = "C:\BackupJobsReport.csv"
# Initialize an array to store job information
$jobInfo = @()
# Get all backup jobs
$backupJobs = Get-VBRJob
# Loop through each backup job
foreach ($job in $backupJobs) {
# Get job name
$jobName = $job.Name
# Get job status
$jobStatus = $job.GetLastResult()
# Get servers included in the backup job
$servers = $job.GetObjectsInJob()
# Create a string with server names separated by comma
$serversString = $servers.Name -join ", "
# Create a custom object with job information
$jobObject = [PSCustomObject]@{
JobName = $jobName
Status = $jobStatus
ServersIncluded = $serversString
}
# Add the custom object to the array
$jobInfo += $jobObject
}
# Export job information to CSV
$jobInfo | Export-Csv -Path $csvFilePath -NoTypeInformation
# Display completion message
Write-Host "Backup job information exported to $csvFilePath"