I'm trying to use this function Get-VSBSession to get error message of failed VM's in SureBackup.
This is my script:
$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