PowerShell script exchange
Post Reply
VTsnow
Influencer
Posts: 13
Liked: 8 times
Joined: Feb 18, 2019 6:34 pm
Full Name: Scott Driver
Contact:

Interesting results from Get-VBRBackupSession

Post by VTsnow »

Curious if anyone else has odd results from this cmdlet. When I run it against a daily job, I get a single session returned, from a year ago.

When I go into the VBR console, and click the report button I get a valid report, so I know the data is out there.

Anyone running into similar? Does anyone know what the Report in VBR console uses on the backend? I'm guessing they are private API's, but if there's another cmdlet...

Image
Vanguard** | vExpert**** | VCP-DCV***** | VirtualVT.wordpress.com | @VTsnowboarder42
Lover of my family, snowboarding, community and bullet points.
VTsnow
Influencer
Posts: 13
Liked: 8 times
Joined: Feb 18, 2019 6:34 pm
Full Name: Scott Driver
Contact:

Re: Interesting results from Get-VBRBackupSession

Post by VTsnow »

My friend Craig shared this KB with me, but now I no longer get even the single session that I shared in the original response.

https://www.veeam.com/kb1995
Vanguard** | vExpert**** | VCP-DCV***** | VirtualVT.wordpress.com | @VTsnowboarder42
Lover of my family, snowboarding, community and bullet points.
VTsnow
Influencer
Posts: 13
Liked: 8 times
Joined: Feb 18, 2019 6:34 pm
Full Name: Scott Driver
Contact:

Re: Interesting results from Get-VBRBackupSession

Post by VTsnow » 1 person likes this post

Anyone who may come across this thread, I've found a workaround.
My particular issue appears to come from use of the -name parameter. By approaching the problem slightly differently, I was able to get the desired results. Please note if you take this approach, your script will run slower, as it will pull in an entire result set AND THEN parse the results.

Image
Vanguard** | vExpert**** | VCP-DCV***** | VirtualVT.wordpress.com | @VTsnowboarder42
Lover of my family, snowboarding, community and bullet points.
masonit
Service Provider
Posts: 327
Liked: 23 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Maso
Contact:

Re: Interesting results from Get-VBRBackupSession

Post by masonit »

Parameter Name is not refering to job name. Very missleading. See examples.

https://helpcenter.veeam.com/docs/backu ... l?ver=95u4

\Masonit
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Interesting results from Get-VBRBackupSession

Post by veremin »

The parameter name defines name of entity the cmdlet returns.

* Get-VBRJob -name defines name of job
* Get-VBRBackupSession -name defines name of backup session

To get all sessions of particular job use slightly different approach:

Code: Select all

Asnp VeeamPSSNapin
$Job = Get-VBRJob -name "Name of your Job"
Get-VBRBackupSession | where {$_.Info.JobId -eq $Job.Id}
OR

Code: Select all

Asnp VeeamPSSNapin
$Job = Get-VBRJob -name "Name of your Job"
Get-VBRBackupSession | where {$_.Info.JobName -eq $Job.Name}
Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests