Simple "Report": Backup Method + Restore Points (CSV+HTML)

PowerShell script exchange

Simple "Report": Backup Method + Restore Points (CSV+HTML)

Veeam Logoby DChiavari » Mon Aug 31, 2015 5:07 pm 3 people like this post

Hi everyone, I thought I'd share with you this little script I wrote for a customer.

Full description is in the initial comment block. The script was very briefly tested, any problem let me know. Feedback is, of course, welcome.

Code: Select all
Simple "Report" for Veeam Backup & Replication with:
    - Job Name
    - Job Method (Incremental / Reversed Incremental)
    - Active Fulls enabled ? (True / False)
    - Synthetic Fulls enabled ? (True / False)
    - Number of configured Restore Points

Output is written to Powershell console, to CSV file and HTML file

This script works only for primary backup jobs (no backup copy jobs, no GFS, etc...)
Tested only on Veeam Backup & Replication v8 Update 2 (v8.0.0.2030)

v0.2 - Danilo Chiavari - August 31st 2015

asnp VeeamPSSnapin

$now = Get-Date -Format yyyyMMdd_HHmm
$jobs = Get-VBRJob | Where {$_.JobType -eq "Backup"}
$results_array = @()

ForEach ($job in $jobs) { 
    $results_array += [ordered]@{JobName=$job.Name; BackupMethod=$job.Options.BackupTargetOptions.Algorithm -replace "Syntethic","Reversed"; ActiveFulls=$job.BackupStorageOptions.EnableFullBackup; SynthFulls=$job.BackupTargetOptions.TransformFullToSyntethic; RestorePoints=$job.Options.BackupStorageOptions.RetainCycles}
#Export to CSV file
$CSVreportfilename = "C:\temp\BackupReport-Method-Retention-" + $now + ".csv"
$results_array | % {New-Object PSObject -Property $_} | Export-CSV $CSVreportfilename

#Export to HTML file
$HTMLreportfilename = "C:\temp\BackupReport-Method-Retention-" + $now + ".html"
$results_array | % {New-Object PSObject -Property $_} | ConvertTo-Html | Out-File $HTMLreportfilename

#Display a table on screen
$results_array | % {New-Object PSObject -Property $_} | ft -AutoSize

Note: the replace operation during array population, in the ForEach loop (line 24) was added for clarity - the internal name of the "Reversed Incremental" backup method is "Syntethic" (sic) and it's easily misleading.

Sample output below shows the different backup methods and settings combinations:
Code: Select all
JobName              BackupMethod ActiveFulls SynthFulls RestorePoints
-------              ------------ ----------- ---------- -------------
BK-VMW-Incr-Forever  Increment          False      False            69
BK-VMW-Reversed      Reversed           False       True            12
BK-VMW-Incr-w-Active Increment           True      False            56
BK-HV-Incr-w-Synth   Increment          False       True             5
Danilo Chiavari
Veeam Systems Engineer - Italy
Veeam Software
Posts: 550
Liked: 107 times
Joined: Thu Feb 02, 2012 7:03 pm
Location: Rome, IT
Full Name: Danilo Chiavari

Return to PowerShell

Who is online

Users browsing this forum: No registered users and 5 guests