PowerShell script exchange
Post Reply
pizzim13
Enthusiast
Posts: 94
Liked: 6 times
Joined: Apr 21, 2011 7:37 pm
Contact:

Retreive VM failure or warning info via Powershell

Post by pizzim13 »

Using powershell, is it possible to pull VM failure or warning info from a job? See screenshot for an example:

Image
Gostev
Chief Product Officer
Posts: 31460
Liked: 6648 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Retreive VM failure or warning info via Powershell

Post by Gostev »

Hi, no I don't believe this is possible with PowerShell cmdlets we have. Thanks.
Sethbartlett
Veteran
Posts: 282
Liked: 26 times
Joined: Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett
Contact:

Re: Retreive VM failure or warning info via Powershell

Post by Sethbartlett »

Once again, another non-supported method. But if you really need this data:

Code: Select all

$Info = [Veeam.Backup.Core.CBackupTaskSession]::GetByJobSession($session.id)
$Info[0].Reason
You get $Session by doing Get-VBRBackupSession. This will allow you what you need. You can do $info |Gm and then if you want to do any of the methods/properties, you will want to do $info[0] as it is an array of objects.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
zaicnupagadi
Novice
Posts: 9
Liked: 1 time
Joined: Nov 03, 2017 6:02 am
Full Name: Pawel Jarpsz
Contact:

Re: Retreive VM failure or warning info via Powershell

Post by zaicnupagadi »

Hi,

Necroposting here but hey why not - seems like "[Veeam.Backup.Core.CBackupTaskSession]::GetByJobSession" does not work anymore, am I right? I look for a quick way to get the warning message for the last backup as this

Code: Select all

$vbrsessions = Get-VBRBackupSession | ?{$_.JobType -eq "Backup" -and $_.EndTime -ge (Get-Date).adddays(-1) -and $_.result -eq "warning" }
takes long time to run.

Any ideas how to get this by not going through all of the sessions but just to see session info for one particular backup job?

J
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Retreive VM failure or warning info via Powershell

Post by oleg.feoktistov »

Hi Pawel,

I have just tested this method in v11 and it has worked. What is it you are trying to do precisely? You know exactly that your last job session finished with warning and you are seeking to get this session? Or are you trying to get the latest session with warning without knowing which one is it?

Thanks,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests