PowerShell script exchange
Post Reply
Andreas Neufert
VP, Product Management
Posts: 6748
Liked: 1408 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Successful VMs per Job to filename for non Veeam tape

Post by Andreas Neufert » 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 
   }
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests