PowerShell script exchange
Post Reply
marius roma
Veteran
Posts: 459
Liked: 5 times
Joined: Feb 01, 2012 12:04 pm
Full Name: Mario
Contact:

How to use Get-VBRBackupSession to get only the last session

Post by marius roma »

How can I use Get-VBRBackupSession to get only the last session for a given job?
I could pass a range of dates, but I don't know when a job was executed lasy time...
Regards
marius
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to use Get-VBRBackupSession to get only the last ses

Post by veremin » 1 person likes this post

You should use CreationTime parameter in arrange list of backup session from the newest to the oldest one, and, then, select the most recent session:

Code: Select all

Get-VBRBackupSession | where {$_.JobName -eq "Name of Job"} | Sort creationtime -Descending | select -First 1
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests