Hi Oleg,
Yesterday, I have been sucessful to get the the result I wanted. Here's my sample script (seems not very elegant):
I will try the method GetOriginalAndRetrySessions() if I'm not too lazy ... not the case at the moment
Thanks
Best regards,
Laurent
Yesterday, I have been sucessful to get the the result I wanted. Here's my sample script (seems not very elegant):
Code:
foreach ($job in $jobsList) {$BackupSessions = Get-VBRBackupSession | Where {$_.jobId -eq $job.Id.Guid} | Where { ($_.CreationTime -ge $startDate) -and ($_.CreationTime -lt $endDate) } | Sort JobName, CreationTimeForEach ($BackupSession in ($BackupSessions | Where { $_.IsRetryMode -eq $false })) {$row = "" | Select JobName, StartTime, EndTime, Result, NbRetry# Si le résultat de la session est "Failed"if ($BackupSession.Result -eq "Failed") {# Recherche les sessions de réessai associées$RetrySessions = $BackupSessions | Where { ($_.IsRetryMode -eq $true) -and ($_.OriginalSessionId -eq $BackupSession.Id) }# Si il y a eu retry sélectionne la dernière session de réessai$LastRetrySession = $RetrySessions | Sort CreationTime | Select -Last 1$row.JobName = $LastRetrySession.JobName$row.StartTime = $LastRetrySession.Info.CreationTime$row.EndTime = $LastRetrySession.Info.EndTime$row.Result = $LastRetrySession.Info.Result$row.NbRetry = $RetrySessions.Count} else {$row.JobName = $BackupSession.JobName$row.StartTime = $BackupSession.Info.CreationTime$row.EndTime = $BackupSession.Info.EndTime$row.Result = $BackupSession.Info.Result$row.NbRetry = 0}$Report += $row}}Thanks
Best regards,
Laurent
Statistics: Posted by Lpt — Mar 13, 2024 3:56 pm






