Help Center
Choose product document...
Veeam Backup & Replication 9.5
PowerShell Reference

Start-VBRWindowsFileRestore

Short Description

Starts Windows VM guest OS file restore.

Applies to

Platform: VMware

Product Edition: Standard, Enterprise, Enterprise Plus

Syntax

Start-VBRWindowsFileRestore [-RestorePoint] <COib> [[-Host] <CHost>] [[-ResourcePool] <CViResourcePoolItem>] [[-Folder] <CViFolderItem>] [-Reason <string>] [-Credentials <CCredentials>]  [<CommonParameters>]

Detailed Description

This cmdlet allows you to restore files stored on disks of VM running Windows or from Veeam Agent backups.

This cmdlet mounts the disks of the backed up VM(s) to the Veeam backup server or other server in your virtual infrastructure. The disks are published directly from the backup file. After the disks are mounted, you can copy the needed files to any disk or folder accessible by Veeam backup server.

To stop the file restore session and unmount the disks, run Stop-VBRWindowsFileRestore.

Start-VBRWindowsFileRestore Important!

You must save the restore session to a variable when you run this cmdlet. Otherwise you will no be able to finalize the restore session with PowerShell.

Run Start-VBRRestoreVMFiles to restore VM configuration files.

Parameters

Parameter

Description

Required

Position

Accept
Pipeline
Input

Accept
Wildcard
Characters

RestorePoint

Specifies the restore point of a VM or a Veeam Agent for Microsoft Windows backup from which you want to restore files.

True

1

True (ByValue,
ByProperty
Name)

False

Reason

Specifies the string with the reason for performing file restore.

False

Named

False

False

Host

Specifies the host to which the snapshot clone/virtual copy must be mounted and on which the temporary VM must be created.

False

2

False

False

Resource
Pool

Specifies the resource pool to which the temporary VM must be placed.

False

3

False

False

Folder

Specifies the folder to which the temporary VM must be placed.

False

4

False

False

Credentials

Specifies the credentials to authenticate with the backup share folder.

False

Named

False

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information about common parameters, see http://go.microsoft.com/fwlink/p/?LinkID=113216.

Example 1

This example shows how to start a restore session for Windows VM guest OS files.

  1. Run Get-VBRBackup to get a backup that contains files which you want to restore. Save the result to the $backup variable.
  2. Run Get-VBRRestorePoint with the $backup variable to get a restore point of a VM. Use the Name parameter to specify the VM name. Save the result to the $restorepoint variable.
  3. Run Start-VBRWindowsFileRestore with the $restorepoint variable. Save the result to the $flerestore variable.

PS C:\PS> $backup = Get-VBRBackup

PS C:\PS> $restorepoint = Get-VBRRestorePoint -Backup $backup -Name "Production VM"

PS C:\PS> $flerestore = Start-VBRWindowsFileRestore -RestorePoint $restorepoint

Example 2

This example shows how to start a restore session for Windows VM guest OS files and restore them to the specified folder.

  1. Run Get-VBRBackup to get a backup that contains files which you want to restore. Save the result to the $backup variable.
  2. Run Get-VBRRestorePoint with the $backup variable to get a restore point of a VM. Use the Name parameter to specify the VM name. Save the result to the $restorepoint variable.
  3. Run Start-VBRWindowsFileRestore with the $restorepoint variable.
  4. Run Get-VBRCredentials to get credentials for the VM. Save the result to the $credentials variable.
  5. Run Get-VBRRestoreSession to get a restore session. Save the result to the $session variable.
  6. Run Start-VBRWindowsGuestItemRestore with the $session and the $credentials variables. Use the RestorePolicy parameter to specify the restore policy.

PS C:\PS> $backup = Get-VBRBackup

PS C:\PS> $restorepoint = Get-VBRRestorePoint -Backup $backup -Name "Production VM"

PS C:\PS> Start-VBRWindowsFileRestore -RestorePoint $restorepoint

PS C:\PS> $credentials = Get-VBRCredentials -Name "CRM DB Administrator"

PS C:\PS> $session = Get-VBRRestoreSession

PS C:\PS> Start-VBRWindowsGuestItemRestore -Path "C:\Files\" -Session $session -RestorePolicy Keep -GuestCredentials $credentials

Example 3

This example shows how to start a restore session for Windows guest OS files and copy these files to the root drive.

  1. The path to the file on the backed up VM is assigned to the $origfile variable.
  2. A new file level restore session is initiated with by running Start-VBRWindowsFileRestore:
  • The list of available restore points produced by the backup job 'Job 1' is obtained with Get-VBRRestorePoint and piped down.
  • The restore points are sorted with Sort-Object method by the "creationtime" property to get the most recent one.
  • The restore session is assigned to the $result variable.
  1. To copy the file, you need to obtain the mount point for the target mounted volume:
  • The path is obtained with the MountSession.MountedDevices property which helps to map the mounted volumes to drives letters of the original VM.
  • The mount point is assigned to the $flrmountpoint variable.
  1. The mount point is used to obtain the path to the file. The path is assigned to the $file variable.
  2. The file is copied to the root of C:\ drive.
  3. The file restore session is stopped with Stop-VBRWindowsFileRestore.

PS C:\PS> $origfile = "C:\Reports\June.xlsx"

PS C:\PS> $result = Get-VBRBackup | where {$_.jobname -eq "Job 1"} | Get-VBRRestorePoint | where {$_.name -eq "VM1"} | Sort-Object creationtime -Descending | Select-Object -First 1 | Start-VBRWindowsFileRestore

PS C:\PS> $flrmountpoint = ($result.MountSession.MountedDevices | ? {$_.DriveLetter -eq (Split-Path -Qualifier $origfile)}).MountPoint

PS C:\PS> $file = $flrmountpoint + (Split-Path -NoQualifier $origfile)

PS C:\PS> Copy $file c:\

PS C:\PS> Stop-VBRWindowsFileRestore $result

Related Commands

Get-VBRRestorePoint

Get-VBRServer

Find-VBRViResourcePool

Find-VBRViFolder

Stop-VBRWindowsFileRestore

Start-VBRWindowsGuestItemRestore

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Agent Management Guide

Veeam Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation