PowerShell script exchange
Post Reply
omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Start-VBRWindowsFileRestore

Post by omorin » Nov 26, 2010 10:45 am

Bonjour,

I search a script using Start-VBRWindowsFileRestore.
I want to copy a file, in fact my exchange files priv1.edb from my Veeam backup to a nas.

Any example ?

:wink:

omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Re: Start-VBRWindowsFileRestore

Post by omorin » Nov 26, 2010 4:16 pm

Bonsoir,

The help given by get-help Start-VBRWindowsFileRestore is wrong, it talks about restoring vm (.vmdk,...) files but not files inside the windows machine.

Confusing...

I think the help file is not correct.

:cry:

Vitaliy S.
Product Manager
Posts: 22773
Liked: 1526 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Start-VBRWindowsFileRestore

Post by Vitaliy S. » Nov 29, 2010 3:25 pm

Hello Olivier,

The help information is correct. The restore procedure is similar to restoring VM files, though there are slight differences. For example if you need to restore readme.txt file located on the drive C on the root folder, you should use the syntax below:

Code: Select all

$result = Get-VBRBackup | where {$_.JobName -eq "Backup Job 1"} | Get-VBRRestorePoint | sort CreationTime -Descending | select -First 1 | Start-VBRWindowsFileRestore
$file = $result.FirstDrive + “:\readme.txt”
Copy $file c:\
Stop-VBRWindowsFileRestore
Hope it helps!

omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Re: Start-VBRWindowsFileRestore

Post by omorin » Dec 28, 2010 11:01 am

This script is OK, a ":" is missing in $file = $result.FirstDrive + “\readme.txt”, the good yntax is $file = $result.FirstDrive + “:\readme.txt”

And you have to close the job with Stop-VBRWindowsFileRestore

Vitaliy S.
Product Manager
Posts: 22773
Liked: 1526 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Start-VBRWindowsFileRestore

Post by Vitaliy S. » Dec 28, 2010 1:23 pm

Olivier, thanks for getting back and posting an update, much appreciated. I've adjusted the script above with your comments.

omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Re: Start-VBRWindowsFileRestore

Post by omorin » Dec 28, 2010 3:07 pm

Ouh !

I had to reboot my Veeam server because of virtual-disk error...
I think that Stop-VBRWindowsFileRestore is not enough, or needs parameters...

michaelschad
Lurker
Posts: 1
Liked: never
Joined: Jul 10, 2009 4:37 pm
Full Name: MIchael Schad
Contact:

Re: Start-VBRWindowsFileRestore

Post by michaelschad » Feb 23, 2011 6:44 am

Hello,
I have the same problem as omorin, the backup file is not closed after dismounting with Stop-VBRWindowsFileRestore. Have anyone a solution ?

Vitaliy S.
Product Manager
Posts: 22773
Liked: 1526 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Start-VBRWindowsFileRestore

Post by Vitaliy S. » Feb 24, 2011 10:36 am

Hello Michael,

Could you please shoot your log files to our support team as it is not expected bahviour. Besides, I would appreicate if you could send me your ticket number, so I could update this topic with the resolution later on.

Thank you!

omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Re: Start-VBRWindowsFileRestore

Post by omorin » Feb 28, 2011 1:52 pm

Still no solution ?

Vitaliy S.
Product Manager
Posts: 22773
Liked: 1526 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Start-VBRWindowsFileRestore

Post by Vitaliy S. » Feb 28, 2011 1:58 pm

Olivier, I haven't seen Michael opening a support case with our technical team, so I cannot update this topic with possible resolution. I would appreciate if you could contact our support guys and investigate this issue together, as we cannot reproduce it in our labs.

omorin
Enthusiast
Posts: 35
Liked: 3 times
Joined: Oct 19, 2010 1:37 pm
Full Name: olivier morin
Location: Bergerac, France
Contact:

Re: Start-VBRWindowsFileRestore

Post by omorin » Mar 08, 2011 10:48 am

Hi,
The virtual disk is visible in the file explorer, the file is correctly copied.
It seems that Stop-VBRWindowsFileRestore does not close the virtual dirves...

System events are (sorry in French):

3/8/2011 11:46:04 2 2 57 VirtualDK N/A HDV-SAUVEGARDE \Device\Virt
3/8/2011 11:46:25 4 0 26 Application Popup N/A HDV-SAUVEGARDE Windows - L'écriture différée a échoué Windows n'a pas pu enregistrer les données du fichier \Device\VirtualDiskVolume1\$MftMirr. Les données ont été perdues. Cette erreur peut être due à une panne de votre matériel ou de votre connexion réseau. Essayez d'enregistrer ce fichier à un autre emplacement.

I have to reboot teh machine.

Gostev
SVP, Product Management
Posts: 24465
Liked: 3413 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Start-VBRWindowsFileRestore

Post by Gostev » Mar 08, 2011 12:03 pm

Hello, please open a support case to let us investigate this behavior more closely. Thanks!

sccit
Lurker
Posts: 2
Liked: never
Joined: Jul 29, 2013 12:33 pm
Contact:

Re: Start-VBRWindowsFileRestore

Post by sccit » Jul 29, 2013 12:36 pm

Dear all,

is there any follow up on this topic ?
we have the exact same issue : veeam transport service keeps a lock on the files and when reviewing the log files, the mount log files says "waiting for next command" as last action.
it seems the stop-VBRWindowsFileRestore does nothing

as a side note, the powershell help for this command suggest you can specify as an optional parameter the mount point to close, but how do one find this mount point reference using powershell commands ?

tx

veremin
Product Manager
Posts: 16699
Liked: 1394 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Start-VBRWindowsFileRestore

Post by veremin » Jul 29, 2013 2:08 pm

It seems that the code provided above missed a required line – Stop-VBRWindowsFileRestore command should be pointed to an [FileRestore] object ($Result, in other words). So, the last line should be:

Code: Select all

Stop-VBRWindowsFileRestore $Result
As to finding a restore point, it can be done using the following script, that will get a latest restore point of a given VM within a specified job:

Code: Select all

Get-VBRBackup | where {$_.jobname -eq "Name of your job"} | Get-VBRRestorePoint | where {$_.name -eq "Name of your VM"} | Sort-Object creationtime -Descending | Select-Object -First 1 


Hope this helps.
Thanks.

sccit
Lurker
Posts: 2
Liked: never
Joined: Jul 29, 2013 12:33 pm
Contact:

Re: Start-VBRWindowsFileRestore

Post by sccit » Jul 29, 2013 2:36 pm

Hi Vladimir,

Tx for the much needed update on this thread, your tips solved the issue, I can now see in the logs the post-restore cleanup performed.
Globally the powershell command set lacks examples, if you ask for detailed help that should include samples, you only get the command syntax.
More sample scripts from Veeam would make an even better product !

Many thanks for the swift reply

veremin
Product Manager
Posts: 16699
Liked: 1394 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Start-VBRWindowsFileRestore

Post by veremin » Jul 29, 2013 2:45 pm

Glad to hear that you’ve finally nailed your issue down.

As to the script examples, the most commonly used scenarios are covered in Getting Started section of this subforum. Anyway, thanks for the feedback; much appreciated.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests