PowerShell script exchange
ianmidge
Novice
Posts: 6
Liked: never
Joined: Mar 04, 2018 7:04 pm
Full Name: Ian Midgley
Contact:

[MERGED] add date range to Get-VBRBackupSession

Post by ianmidge »

Hi guys, I am using Get-VBRBackupSession in a number of scripts and am only interested in the last few weeks of jobs. I am currently filtering the output using where-object but given we have been using Veeam for some time there are a lot of sessions and Get-VBRBackupSession is taking an age to return them all. It would be really useful to have -before and -after options for Get-VBRBackupSession so that the result set it returns is much smaller.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script too slow, looking for optimisation

Post by veremin »

What product version are you using? In Update 2 we removed unnecessary calls to db in Get-VBRBackupSession cmdlet. So, these days it should work more or less fast. Or you experience different behaviour?

By the way, check workarounds mentioned on the first page of this topic.

Thanks.
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

Re: Script too slow, looking for optimisation

Post by marius roma »

Any update?
Regards
marius
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Script too slow, looking for optimisation

Post by veremin »

Marius, could you be more specific? What update you're looking for? Thanks.
maanlicht
Enthusiast
Posts: 26
Liked: 5 times
Joined: Apr 05, 2023 1:06 pm
Full Name: maanlicht
Contact:

Re: Script too slow, looking for optimisation

Post by maanlicht » 2 people like this post

Found this great post even after 6 years it turned out to be a great solution. We are now on v12 but it seems the issue still persists. In my case Get-VBRbackupSession takes 4 minutes to complete running on SSD with plenty of resources. In my use case this is unacceptably long. The '[Veeam.Backup.DBManager.CDBManager]::Instance.BackupJobsSessions.GetAll()' command was able to bring this down to 14 sec. Just wanted to give this feedback.
maanlicht
Enthusiast
Posts: 26
Liked: 5 times
Joined: Apr 05, 2023 1:06 pm
Full Name: maanlicht
Contact:

Re: Script too slow, looking for optimisation

Post by maanlicht »

For anyone reading this in the future. In v12 the .net solution only works for regular backup jobs but does not return any sessions for BackupCopy jobs.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests