Selecting a restore point

PowerShell script exchange

Selecting a restore point

Veeam Logoby mschlott » Thu Dec 12, 2013 7:26 pm

I have about 5000 files that need to be restored in a text document. I have never used Veeam from PowerShell before and am a PowerShell neophyte.

First is there any way I can restore all the files listed in a text document without using powershell? I am assuming not.

Per the Veeam B&R powershell reference guide I can use Start-VBRRestoreVMFiles for this. The following example is given.

Start-VBRRestoreVMFiles –RestorePoint $point –Server $host –Path “C:\BackupFiles”

I know how to get the $host for this, but how do I get a restore point other than the first or last one.

get-vbrrestorepoint -backup (Get-VBRbackup -name "MYBACKUPJOB") -name MYVMNAME

I can use the above command to get a list of restore points and use select to get the last one. How do I get one from a specific date. The one I want looks like this.

MYVMNAME 11/19/2013 8:04:57 PM Increment False

Also, if I exclude the -Path variable, will the files restore to their original location?
mschlott
Enthusiast
 
Posts: 83
Liked: 2 times
Joined: Thu Jan 20, 2011 5:45 pm
Full Name: Mike Schlottman

Re: Selecting a restore point

Veeam Logoby mschlott » Thu Dec 12, 2013 7:36 pm

I found a way to do this, but if someone has a better way let me know.

get-vbrrestorepoint -backup (Get-VBRbackup -name "MYBACKUPJOB") -name MYVMNAME | select -last 14 | select -first 1
mschlott
Enthusiast
 
Posts: 83
Liked: 2 times
Joined: Thu Jan 20, 2011 5:45 pm
Full Name: Mike Schlottman

Re: Selecting a restore point

Veeam Logoby v.Eremin » Mon Dec 23, 2013 1:16 pm

Hi, Mike,

In fact, each Restore Point has parameter called CreationTime which can be used in order to distinguish restore points. So, the following script should do the trick:

Code: Select all
asnp VeeamPSSnapin
$Backup = Get-VBRBackup -Name "MYBACKUPJOB"
$Backup | Get-VBRRestorePoint -name "MYVMNAME" | where {$_.CreationTime -eq "11/19/2013 8:04:57"}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13291
Liked: 973 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 9 guests