Simple Request: Generate a list of restore points

PowerShell script exchange

Simple Request: Generate a list of restore points

Veeam Logoby meeyou » Wed Jan 16, 2013 8:23 pm

Get-VBRRestorePoint <jobname>?
meeyou
Influencer
 
Posts: 19
Liked: never
Joined: Tue Oct 16, 2012 5:47 pm
Full Name: John White

Re: Simple Request: Generate a list of restore points

Veeam Logoby tsightler » Wed Jan 16, 2013 8:34 pm

Code: Select all
Get-VBRBackup -Name <jobname> | Get-VBRRestorePoint
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Simple Request: Generate a list of restore points

Veeam Logoby meeyou » Wed Jan 16, 2013 8:37 pm

Nice. Thank you.

Any parameters for sorting results?
meeyou
Influencer
 
Posts: 19
Liked: never
Joined: Tue Oct 16, 2012 5:47 pm
Full Name: John White

Re: Simple Request: Generate a list of restore points

Veeam Logoby Sethbartlett » Wed Jan 16, 2013 8:38 pm

It's actually done on the backups, not the jobs themselves.

Code: Select all
(Get-VBRBackup | Get-VBRRestorePoint) | Out-File "C:\RestorePoints.txt"


This should output a list of all the restore points to a "RestorePoints.txt" file on your C:\ drive.
Skype: Sethbartlett88 - Make sure to label who you are and why you want to add me ;)
Twitter: @sethbartlett
If my post was helpful, please like it. Sometimes twitter is quicker to hit me up if you need me.
Sethbartlett
Expert
 
Posts: 282
Liked: 25 times
Joined: Wed Nov 10, 2010 6:51 pm
Full Name: Seth Bartlett

Re: Simple Request: Generate a list of restore points

Veeam Logoby Martin9700 » Wed Jan 16, 2013 8:43 pm

meeyou wrote:Nice. Thank you.

Any parameters for sorting results?


Sorting can be done by piping the results into SORT:

Code: Select all
Get-VBRBackup -name "job name" | Get-VBRRestorePoint | Sort VmName


You can see all the available properties and methods by piping into Get-Member:

Code: Select all
Get-VBRBackup -name "job name" | Get-VBRRestorePoint | Get-Member
Martin
www.thesurlyadmin.com
@thesurlyadm1n
Martin9700
Influencer
 
Posts: 17
Liked: 3 times
Joined: Wed Nov 10, 2010 2:18 pm
Location: Massachusetts
Full Name: Martin Pugh

Re: Simple Request: Generate a list of restore points

Veeam Logoby meeyou » Wed Jan 16, 2013 8:46 pm

Thanks so much, learning a ton about powershell in general from this thread.
meeyou
Influencer
 
Posts: 19
Liked: never
Joined: Tue Oct 16, 2012 5:47 pm
Full Name: John White

Re: Simple Request: Generate a list of restore points

Veeam Logoby tsightler » Wed Jan 16, 2013 8:56 pm

meeyou wrote:Nice. Thank you.

Any parameters for sorting results?


You have all the capabilities of Powershell at your fingertips for sorting/filtering:

Code: Select all
Get-VBRBackup -Name "<JobName>" | Get-VBRRestorePoint | Sort Name,CreationTime

Will produce output sorted by VM name and then creation date/time in ascending order.

I prefer a little more complex where name is sorted ascending, and creation time in descending order, so that VMs are in alphabetical order, but most recent restore points are listed first:

Code: Select all
Get-VBRBackup -Name "<JobName>" | Get-VBRRestorePoint | Sort Name,@{Expression = {$_.CreationTime}; Ascending = $false}
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests