PowerShell script exchange
Post Reply
alessandro.pollino
Lurker
Posts: 1
Liked: never
Joined: Oct 28, 2019 8:36 pm
Contact:

Get error/warning message of VM's in SureBackup

Post by alessandro.pollino »

Hi,
I'm tring to using this function Get-VSBSession to get error/warning message of VM's in SureBackup.

This is my script:

Code: Select all

$vbrsessions = Get-VSBSession | ?{$_.result -ne "success"}
foreach ($session in $vbrsessions)
{
    foreach ($failedVM in $session.GetTaskSessionsByResult(("failed")))
   {
       Write-Host "Job Name:" $failedVM.JobName
       Write-Host "Status:" $FailedVM.Info.Result 
       Write-Host "VM:" $failedVM.Name
       Write-Host "Error:" ???
   }
What is the command to get the error message?

Thanks
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get error/warning message of VM's in SureBackup

Post by veremin »

Don't have a SureBackup job at hand, but you can try something similar:

Code: Select all

$FailedVM.Logger.GetLog() | ? ( $_.Status -eq "EFailed" } | Select-Object Title
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests