VBR 9(u2) Powershell question

PowerShell script exchange

VBR 9(u2) Powershell question

Veeam Logoby nbarron » Mon Oct 03, 2016 7:48 pm

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.
nbarron
Service Provider
 
Posts: 2
Liked: never
Joined: Mon Oct 03, 2016 7:43 pm
Full Name: Nick Barron

Re: VBR 9(u2) Powershell question

Veeam Logoby PTide » Tue Oct 04, 2016 10:57 am

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
PTide
Veeam Software
 
Posts: 3019
Liked: 246 times
Joined: Tue May 19, 2015 1:46 pm

Re: VBR 9(u2) Powershell question

Veeam Logoby tdewin » Tue Oct 04, 2016 12:05 pm 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
tdewin
Veeam Software
 
Posts: 1043
Liked: 361 times
Joined: Fri Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin

Re: VBR 9(u2) Powershell question

Veeam Logoby nbarron » Tue Oct 04, 2016 12:36 pm

Thanks for your help. I'll begin building off that.
nbarron
Service Provider
 
Posts: 2
Liked: never
Joined: Mon Oct 03, 2016 7:43 pm
Full Name: Nick Barron


Return to PowerShell



Who is online

Users browsing this forum: Bing [Bot] and 4 guests