get multi failure from VBRBackupSession

PowerShell script exchange

get multi failure from VBRBackupSession

Veeam Logoby koenhalfwerk » Mon Aug 24, 2015 7:21 am

Hello VEEAM forum,

I'm using Powershell to get the status of backup jobs in the last 48 hours, including any reasons for failure.

But when the job has multiple reasons for failure, I only seem to get the last (which is a silly warning in this case).

I'm using both
get-VBRBackupSession -Name "really specific name" | $_.info.reason
and
[Veeam.Backup.Core.CBackupTaskSession]::GetByJobSession($job.id)
(which should be able to hold multiple entries).

*examples are simplefied and work, but i can post more scripts pieces or all to clarify*

Can anyone help me get multiple reasons for failure?
koenhalfwerk
Lurker
 
Posts: 2
Liked: never
Joined: Mon Aug 24, 2015 7:09 am

Re: get multi failure from VBRBackupSession

Veeam Logoby koenhalfwerk » Mon Aug 24, 2015 9:15 am

update: I am able to get-content from the logs, which does contain the error info, but that is kinda convoluted.
koenhalfwerk
Lurker
 
Posts: 2
Liked: never
Joined: Mon Aug 24, 2015 7:09 am

Re: get multi failure from VBRBackupSession

Veeam Logoby v.Eremin » Mon Aug 24, 2015 11:10 am

If you're looking for detailed information regarding errors, etc, you should query logger property of task sessions and, then, sort it however you want. The following example shows how to do it for the latest job session:

Code: Select all
(Get-VBRJob -name "Name").FindLastSession().logger.getlog().updatedrecords.title

The following topics related to PS reporting might be also useful: 1, 2.

Thanks.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests