PowerShell script exchange
-
alessandro.pollino
- Lurker
- Posts: 1
- Liked: never
- Joined: Oct 28, 2019 8:36 pm
-
Contact:
Post
by alessandro.pollino »
this post
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:
Post
by veremin »
this post
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!
Users browsing this forum: No registered users and 11 guests