PowerShell script exchange
Post Reply
scavern
Novice
Posts: 7
Liked: never
Joined: May 04, 2015 11:00 am
Contact:

FindLastSession method does not exist for Endpoint backups

Post by scavern » 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: May 04, 2015 11:00 am
Contact:

Get-VBREPJob last session

Post by scavern » 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()

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

Re: Get-VBREPJob last session

Post by veremin » 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.

scavern
Novice
Posts: 7
Liked: never
Joined: May 04, 2015 11:00 am
Contact:

Re: Get-VBREPJob last session

Post by scavern » May 19, 2015 10:35 am

Thanks - I have resolved this. Thread can be closed.

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

Re: Get-VBREPJob last session

Post by veremin » 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests