PowerShell script exchange
Post Reply
romura
Influencer
Posts: 13
Liked: never
Joined: Aug 19, 2011 9:24 pm
Contact:

Daily Backup Report

Post by romura »

Is there any way to provide a daily detailed backup report of each VM using powershell? I like the reports that spit out after every job but I need that consolidated into one report that's emailed daily. I've searched these forums and tried some of the powershell examples but no luck. Maybe it's because I'm on VBR 7 and most of the scripts were made for v6 and below?

Any help or examples would be appreciated.
Vitaliy S.
VP, Product Management
Posts: 27112
Liked: 2719 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Daily Backup Report

Post by Vitaliy S. »

Hi romura,

Let's wait what our PowerShell guru can offer you, meanwhile if you need this info right now, you may want to take a look at predefined backup reports in Veeam ONE.

Thanks!
soehl
Enthusiast
Posts: 57
Liked: 8 times
Joined: May 09, 2011 12:43 pm
Full Name: Sebastian
Location: Germany
Contact:

Re: Daily Backup Report

Post by soehl »

What do you need exactly?! All the informations from the normal emails or just a list with the backuped vms?!

This little code snippet generates a CSV-file on Desktop, with all backup sessions in the last 24 hours.
Maybe it is a good starting point:

Code: Select all

if ((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null) {Add-PsSnapin VeeamPSSnapIn}

$outputfile = "$env:UserProfile\Desktop\backupedvms.csv"

$vbrsessions = Get-VBRBackupSession | Where-Object {$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).addhours(-24)}
$backupedvms = foreach ($session in $vbrsessions) {$session.gettasksessions()| Select Name, Status, Jobname } 
$setarray = @("Name", "Status", "JobName")
$backupedvms | Select-Object -Property $setarray | Export-CSV -Encoding "UTF8" -NoTypeInformation $outputfile
best regards
romura
Influencer
Posts: 13
Liked: never
Joined: Aug 19, 2011 9:24 pm
Contact:

Re: Daily Backup Report

Post by romura »

Thank you Soehl! This would be a good starting point.

It would be nice to get all the information from the normal emails with backup sizes, times, etc. all together in one. We have a lot of backup jobs so the normal emails would just be a lot of SPAM to other admins and management that get it.
romura
Influencer
Posts: 13
Liked: never
Joined: Aug 19, 2011 9:24 pm
Contact:

Re: Daily Backup Report

Post by romura »

Sorry, I got this to work and it's pretty awesome!
http://forums.veeam.com/powershell-f26/ ... 13422.html
Gav@GH
Influencer
Posts: 21
Liked: 15 times
Joined: Jul 20, 2012 12:27 am
Contact:

Re: Daily Backup Report

Post by Gav@GH »

Glad you liked it! I randomly jumped on the forum tonight looking for a few ideas for something else I'm working and saw your post. Let me know if you have any questions, tips or bug fixes.
Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests