PowerShell script exchange
Post Reply
meelisn
Influencer
Posts: 12
Liked: never
Joined: Jun 09, 2020 2:21 pm
Full Name: Meelis Nigols
Contact:

Veeam Configuration Backup last run time

Post by meelisn »

There is date in GUI. How can I get the same info with PowerShell?

Get-VBRConfigurationBackupJob gives me LastResult and LastState, but not the date last backup was performed.

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

Re: Veeam Configuration Backup last run time

Post by oleg.feoktistov » 1 person likes this post

Hi Meelis,

Currently, there is no supported way to do that.
However, with .NET methods you could try the following:

Code: Select all

$jobType = [Veeam.Backup.Model.EDbJobType]::ConfBackup
$configBackup = [Veeam.Backup.Core.CBaseSession]::FindLastByJobType($jobType)
It should give you the last run time.

Thanks,
Oleg

meelisn
Influencer
Posts: 12
Liked: never
Joined: Jun 09, 2020 2:21 pm
Full Name: Meelis Nigols
Contact:

Re: Veeam Configuration Backup last run time

Post by meelisn »

Using .NET is OK, unsupported is not. When will there be supported way to get such kind of information?

veremin
Product Manager
Posts: 18421
Liked: 1822 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam Configuration Backup last run time

Post by veremin »

Unsupported means that we cannot guarantee that the very same approach will work with the next product versions.

As to your question, currently we cannot provide any ETA.

Thanks!

jffroment
Lurker
Posts: 2
Liked: never
Joined: Apr 24, 2021 9:49 am
Contact:

Re: Veeam Configuration Backup last run time

Post by jffroment »

This .NET method returns the last configuration backup attempt.
Is there a way to get the last successfull configuration backup, as we can see in the VBR console.

Thanks a lot

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

Re: Veeam Configuration Backup last run time

Post by oleg.feoktistov »

Hi,

Yes, if what Get-VBRConfigurationBackupJob shows is not quite it, there is a way through .NET classes:

Code: Select all

$configJob = [Veeam.Backup.Core.CConfigurationBackupJob]::Find()
$configBackupSession = $configJob.FindLastSessionByResults('Success') 
Thanks,
Oleg

jffroment
Lurker
Posts: 2
Liked: never
Joined: Apr 24, 2021 9:49 am
Contact:

Re: Veeam Configuration Backup last run time

Post by jffroment »

Great, it's perfect !

Is there a online help for all existing .NET classes ?

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

Re: Veeam Configuration Backup last run time

Post by oleg.feoktistov »

There isn’t any official documentation on .NET classes as they are not supported. But you can consider this forum an online help for such corner cases. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests