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

PowerShell script exchange

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

Veeam Logoby marius roma » Mon May 25, 2015 10:31 am

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
marius roma
Expert
 
Posts: 317
Liked: 3 times
Joined: Wed Feb 01, 2012 12:04 pm
Full Name: Mario

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

Veeam Logoby v.Eremin » Mon May 25, 2015 11:16 am 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.
v.Eremin
Veeam Software
 
Posts: 13281
Liked: 970 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 6 guests