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 » May 02, 2014 1:09 am

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.
Product Manager
Posts: 22127
Liked: 1382 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Daily Backup Report

Post by Vitaliy S. » May 02, 2014 2:05 pm

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: 46
Liked: 7 times
Joined: May 09, 2011 12:43 pm
Full Name: Sebastian
Location: Germany
Contact:

Re: Daily Backup Report

Post by soehl » May 02, 2014 3:44 pm

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 » May 02, 2014 6:48 pm

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 » May 03, 2014 1:44 am

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 » May 18, 2014 1:38 pm

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 5 guests