PowerShell script exchange
Post Reply
nbarron
Service Provider
Posts: 2
Liked: never
Joined: Oct 03, 2016 7:43 pm
Full Name: Nick Barron
Contact:

VBR 9(u2) Powershell question

Post by nbarron »

Hello,

I'm not a veteran to either Veeam or Powershell. I was looking around and couldn't find this. I am looking for a script/command I can run on a VBR machine to pull backup success rates per job. I mean, is there a way to show that 28 of the last 30 jobs were successful? I'm sure I'm missing something online. Any help is appreciated.
PTide
Product Manager
Posts: 6408
Liked: 724 times
Joined: May 19, 2015 1:46 pm
Contact:

Re: VBR 9(u2) Powershell question

Post by PTide »

Hi,

This

Code: Select all

Get-VBRBackupSession | where {$_.Result -eq "Success" -and $_.JobName -eq "Job Name"} | measure
will count successful sessions for the "Job Name" job. You can substitute "Success" with "Failed". For more info about output format etc please use forum search.

Thanks
tdewin
Veeam Software
Posts: 1775
Liked: 646 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: VBR 9(u2) Powershell question

Post by tdewin » 1 person likes this post

Also if you want to query the sessions multiple times, it better to first cache all sessions and then do your query e.g.

Code: Select all

$sess = Get-VBRBackupSession
$sess | where { $_.JobName -eq "Job 1"}
$sess | where { $_.JobName -eq "Job 2"}
Especially if you loop over jobs, do a one time get-vbrbackupsession outside the loop and then use the local result
nbarron
Service Provider
Posts: 2
Liked: never
Joined: Oct 03, 2016 7:43 pm
Full Name: Nick Barron
Contact:

Re: VBR 9(u2) Powershell question

Post by nbarron »

Thanks for your help. I'll begin building off that.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests