PowerShell script exchange
Post Reply
koenhalfwerk
Lurker
Posts: 2
Liked: never
Joined: Aug 24, 2015 7:09 am
Contact:

get multi failure from VBRBackupSession

Post by koenhalfwerk »

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: Aug 24, 2015 7:09 am
Contact:

Re: get multi failure from VBRBackupSession

Post by koenhalfwerk »

update: I am able to get-content from the logs, which does contain the error info, but that is kinda convoluted.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: get multi failure from VBRBackupSession

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests