Successful VMs per Job to filename for non Veeam tape

PowerShell script exchange

Successful VMs per Job to filename for non Veeam tape

Veeam Logoby Andreas Neufert » Wed Sep 21, 2016 10:45 am 2 people like this post

If you Backup Veeam files with 3rd Party sofware to tape you need some documentation what VM is in what Veeam backup file.
Below you can find an example how to read the Successfull VMs from last backup run an place it as file in the backup folder.
In case of a restore you can start the 3rd party restore wizard and search for the VM names and the folder where they where backed up.

This is an example script it should be modified for your needs.

Code: Select all
asnp "VeeamPSSnapIn" -ErrorAction SilentlyContinue
$Job = "WIN"
$JobPath = "c:\Backups\WIN"

$vbrsessions = Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.JobName -eq $Job} | Sort-Object CreationTimeUTC -Descending
$lastvbrsessions = $vbrsessions[0]

$successfulvms = $lastvbrsessions.gettasksessions() | Where-Object {$_.Status -ne "Failed"}

foreach ($vm in $successfulvms) {
$filetocreate = $JobPath+"\"+$vm.Name
" " > $filetocreate
   }
Andreas Neufert
Veeam Software
 
Posts: 2200
Liked: 360 times
Joined: Wed May 04, 2011 8:36 am
Location: Germany
Full Name: @AndyandtheVMs Veeam PM

Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests