Skip to main content

[PowerShell] Export VBR console job logs

  • December 3, 2020
  • 7 comments
  • 1530 views

vNote42
Forum|alt.badge.img+12
  • On the path to Greatness
  • 1246 comments

These days I invested the possibility to programmatically export the same job log shown in VBR console (GUI). @JMeixner gave me the missing link. Now I want to share my outcome here.


First, select the backup session of the job you want to get the log from. To select the job session run latest, you can do this with a command like this:

$BackupSession = Get-VBRBackupSession -Name "Job 1*" | Sort-Object CreationTime | Select-Object -last 1

Here the name of the job is actually "Job 1". But -Name is the name of the running job. This means it includes a postfix like "(Incremental)", therefore *.

 

I use -Name because this is much faster than using | where {$_.jobname -eq "Job 1"}

When you have the backup session, run this to get the logs for each VM in this job.

foreach ($Task in ($BackupSession | Get-VBRTaskSession)) {
$Task.logger.getlog().updatedrecords | select @{N="VM"; e={$task.name}}, starttime, status, title | sort starttime
}

 

 

By the way, there is a hidden feature in the VBR console: If you want a (sometimes even more detailed) log including date/time, mark all lines, right-click, copy to clipboard and past in an editor.

 

 

 

7 comments

vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 3, 2020

I forgot to mention, there is also a way to get the log of the job, not a single VM. This can be done by a slightly change in the loop:

foreach ($Task in ($BackupSession)) {
$Task.logger.getlog().updatedrecords | select @{N="VM"; e={$task.name}}, starttime, status, title | sort starttime
}

 


eprieto
Forum|alt.badge.img+9
  • Veeam Legend
  • 168 comments
  • December 4, 2020

wow very good !!! :clap:  


haslund
Forum|alt.badge.img+14
  • Mr. VMCE
  • 396 comments
  • December 4, 2020

Great post @vNote42! I didn’t even realize the last bonus tip with selecting all lines and copy to the clipboard was available. Thank you for sharing.


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 4, 2020

Great post @vNote42! I didn’t even realize the last bonus tip with selecting all lines and copy to the clipboard was available. Thank you for sharing.

You are welcome! 

There are some hidden features in VBR console. Here you can find more of these secrets: https://www.running-system.com/veeam-backup-and-replication-update-4-valuable-secrets/


haslund
Forum|alt.badge.img+14
  • Mr. VMCE
  • 396 comments
  • December 4, 2020

Great post @vNote42! I didn’t even realize the last bonus tip with selecting all lines and copy to the clipboard was available. Thank you for sharing.

You are welcome! 

There are some hidden features in VBR console. Here you can find more of these secrets: https://www.running-system.com/veeam-backup-and-replication-update-4-valuable-secrets/

Oh snap, very nice collection Wolfgang. Are you planning a similar list for v10?


vNote42
Forum|alt.badge.img+12
  • Author
  • On the path to Greatness
  • 1246 comments
  • December 4, 2020

Great post @vNote42! I didn’t even realize the last bonus tip with selecting all lines and copy to the clipboard was available. Thank you for sharing.

You are welcome! 

There are some hidden features in VBR console. Here you can find more of these secrets: https://www.running-system.com/veeam-backup-and-replication-update-4-valuable-secrets/

Oh snap, very nice collection Wolfgang. Are you planning a similar list for v10?

The list wasn't mine. It is written by a fellow, now working for Veeam :)


gulzarshaikhveeam
Forum|alt.badge.img+1
  • Experienced User
  • 140 comments
  • January 13, 2021

Excellent post! kudos.