PowerShell script exchange
Post Reply
snowmizer
Enthusiast
Posts: 26
Liked: never
Joined: May 02, 2011 8:35 pm
Contact:

Windows File Level Restore

Post by snowmizer »

I am trying to write a Powershell script that will restore a test file from my VMs in my Veeam Backups (running Veeam v6.0). If I'm reading correctly I need to use the start-vbrwindowsfilerestore cmdlet. However, when I try to restore a file I get a message "Cannot find path". I verified that the file I am restoring is in the path I specified. I also verified that the file is on the backups using the restore option in both the "Backup & Replication" console as well as the "Enterprise Manager" console.

What am I doing wrong?

Here's the script code I'm running:

$result = Get-VBRBackup | where {$_.JobName -eq "Backup_My_Servers"} | Get-VBRRestorePoint | sort CreationTime -Descending | where {$_.VMName -eq "ServerA"} | select -First 1 | Start-VBRWindowsFileRestore
$file = "c:\readme.txt”
Copy $file "E:\Special Restores\"
Stop-VBRWindowsFileRestore
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Updated below

Post by ThomasMc »

Try this out

Code: Select all

$WFLR = Get-VBRBackup -Name "Job Name" | Get-VBRRestorePoint -Name "vm.lab.local" |
	Sort CreationTime -Descending | Select -First 1 | Start-VBRWindowsFileRestore

Copy "$($WFLR.Drives)\readme.txt" "E:\Special Restores\"
Stop-VBRWindowsFileRestore
I suppose if the VM has multiple drives then you'll want to tweak it a little
snowmizer
Enthusiast
Posts: 26
Liked: never
Joined: May 02, 2011 8:35 pm
Contact:

Re: Windows File Level Restore

Post by snowmizer »

Doesn't like the $WFLR.Drives option. My test file is c:\testfile.vbs but it looks for the file in C:\Users\...\Veeam.Backup.Powershell.Model.FileRestore.Drives\testfile.vbs.
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Windows File Level Restore

Post by ThomasMc »

Change it to

Code: Select all

"$($WFLR.Drives)\testfile.vbs"
It mounts it into a really long path for some reason i.e

Code: Select all

C:\Documents and Settings\Administrator.lab\Local Settings\Temp\1\scnrximq.54e
or whatever the alternative is for 2008
snowmizer
Enthusiast
Posts: 26
Liked: never
Joined: May 02, 2011 8:35 pm
Contact:

Re: Windows File Level Restore

Post by snowmizer »

That gave me a wierd error...

Failed to initialize log [C:\ProgramData\Veeam\Backup\Aux.VeeamProxyClient.log].

Incorrect function
Seek operation has failed. File: [C:\ProgramData\Veeam\Backup\Aux.VeeamProxyClie
nt.log]. Distance to move: [0]. Move method: [FILE_END].
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Windows File Level Restore

Post by ThomasMc »

Lets try it a little different again

Code: Select all

cd $WFLR.Drives
Copy "readme.txt" "E:\Special Restores\"
Can you confirm that the VM this backup is for only has one drive attached to it?
snowmizer
Enthusiast
Posts: 26
Liked: never
Joined: May 02, 2011 8:35 pm
Contact:

Re: Windows File Level Restore

Post by snowmizer »

It has more than one drive but only one is backed up via Veeam at this time (because of space constraints).
snowmizer
Enthusiast
Posts: 26
Liked: never
Joined: May 02, 2011 8:35 pm
Contact:

Re: Windows File Level Restore

Post by snowmizer »

Working with support on this issue and discovered that the cmdlet Start-VBRWindowsFileRestore is either broken or 1/2 completed. Anyone else have any advice on how I can achieve this objective via scripting. I really can't afford to have to do a manual restore on every server, every month end.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests