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 »

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 »

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: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBREPJob last session

Post by veremin »

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 »

Thanks - I have resolved this. Thread can be closed.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get-VBREPJob last session

Post by veremin »

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 15 guests