Get-VBREPJob last session

PowerShell script exchange

FindLastSession method does not exist for Endpoint backups

Veeam Logoby scavern » Mon May 04, 2015 11:07 am

Below is an example of how I would get the session ID for the last session for a SureBackup job.

Code: Select all
$job1=Get-VSBJob | where {$_.Name -eq $name}
$jobid=$job1.FindLastSession().Id
WRITE-HOST "The sessionID for this job is: " $jobid


However I see that the method FindLastSession() does not exist for Get-VBREPJob.

I'm using the same method on Get-VBRJob and GetVBRTapeJob as well.

Does anyone have any suggestions on how I can work around this?
scavern
Novice
 
Posts: 7
Liked: never
Joined: Mon May 04, 2015 11:00 am

Get-VBREPJob last session

Veeam Logoby scavern » Mon May 04, 2015 11:56 am

Is it possible to get last session info with Get-VBREPJob in the same way as Get-VBRTapeJob

I use the following method to get last session infofor tape jobs, this however is not possible with GET-VBREPJob. Does anyone have any suggestions on how I can workaround this?

Code: Select all
    $Job = Get-VBRTapeJob -name blablabla
    $Session = $Job.FindLastSession()
scavern
Novice
 
Posts: 7
Liked: never
Joined: Mon May 04, 2015 11:00 am

Re: Get-VBREPJob last session

Veeam Logoby v.Eremin » Wed May 06, 2015 2:24 pm

In order to get EP sessions you have to use Get-VBREPSession commandlet. Then, you can filter out the resulting list, using creationtime ( or something; I'm currently out of the office, so not sure about naming) as querying parameter, and select the latest one. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get-VBREPJob last session

Veeam Logoby scavern » Tue May 19, 2015 10:35 am

Thanks - I have resolved this. Thread can be closed.
scavern
Novice
 
Posts: 7
Liked: never
Joined: Mon May 04, 2015 11:00 am

Re: Get-VBREPJob last session

Veeam Logoby v.Eremin » Tue May 19, 2015 10:43 am

Glad to hear my input was helpful. Should other help be needed, don't hesitate to let us know. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 4 guests