Code: Select all
$timespan = new-timespan -days 2
try{
foreach($Job in (Get-VBRJob))
{
$Session = $Job.FindLastSession()
$lastrun = $Job.LatestRunLocal
if(!$Session){continue;}
$Tasks = $Session.GetTaskSessions()
foreach($task in $tasks){
$hostinfo = $task | select Name, Status
if (((get-date) - $lastrun) -gt $timespan) {
"$($hostinfo.Name) $($hostinfo.Status) NOTREADY" | add-content "UpdateStatus"
} else {
"$($hostinfo.Name) $($hostinfo.Status) READY" | add-content "UpdateStatus"
}
}
}
........
However, i cannot seem to find this same information within Get-VBRComputerBackupJob, or any other module for that matter. Can someone help me find this info for my physical hosts?