PowerShell script exchange
Post Reply
cornel.florea
Lurker
Posts: 1
Liked: never
Joined: Feb 11, 2021 6:18 am
Full Name: Corne Florea
Contact:

Get last result for Windows Agent job and Tape job

Post by cornel.florea »

Hello ,

I am trying to build a failure report for all types of sessions. I manage do get the results with Get-VBRBackupSession

but the Tape jobs and Windows agent jobs are not included. I tried Get-VBRComputerBackupJobSession but it doesn't filter anything.

any other way to get Tape and Agent jobs?

oleg.feoktistov
Veeam Software
Posts: 1006
Liked: 364 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get last result for Windows Agent job and Tape job

Post by oleg.feoktistov »

Hi and welcome to the R&D Forums!

For agent backup job sessions use Get-VBRComputerBackupJobSession. As for tape job sessions - we have Get-VBRSession, but we are planning to enhance tape sessions support in future releases since this cmdlet is pretty old and takes info from table with general info anyways. It also does require -Job parameter, so you'll need to loop over tape jobs array:

Code: Select all

$tapeJobs = Get-VBRTapeJob
foreach ($tapeJob in $tapeJobs) {
  Get-VBRSession -Job $tapeJob
}
Thanks,
Oleg

oleg.feoktistov
Veeam Software
Posts: 1006
Liked: 364 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Get last result for Windows Agent job and Tape job

Post by oleg.feoktistov »

Forgot to mention that we are aware of filtering issues with Get-VBRComputerBackupJobSession cmdlet and already created bug for that.
You might try using the code below though for getting the last agent backup job session:

Code: Select all

$session = Get-VBRComputerBackupJobSession | Sort-Object -Descending -Property CreationTime
$session[0] 
Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests