Copy-VBRWindowsGuestItem

Short Description

Copies Microsoft Windows guest OS files to the target host.

Important

This cmdlet is available starting from Veeam Backup & Replication 11a (build 11.0.1.1261).

Product Edition: Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

Copy-VBRWindowsGuestItem -Item <VBRFLRFsItem[]> -TargetFolder <string> -Session <CRestoreSession> [-KeepPermissionsAndOwnership] [-GuestCredentials <CCredentials>]  [<CommonParameters>]

Detailed Description

This cmdlet copies Microsoft Windows guest OS files to the target host.

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Item

Specifies an array of Microsoft Windows guest OS files. The cmdlet will copy these files.

Accepts the VBRFLRFsItem[] object. To create this object, run the Get-VBRWindowsGuestItem cmdlet.

True

Named

True (ByValue,
ByProperty
Name)

TargetFolder

Specifies a folder in the target machine. The cmdlet will copy the guest OS files to this folder.

String

True

Named

False

Session

Specifies a restore session of Microsoft Windows guest OS files. The cmdlet will use this session to copy guest OS files.

Accepts the CRestoreSession object. To create this object, run the Start-VBRWindowsFileRestore cmdlet.

True

Named

False

KeepPermissionsAndOwnership

Defines that the cmdlet will keep custom permissions and the ownership of the copied guest OS files.

If you do not provide this parameter, the cmdlet will restore guest OS files with default permissions and ownership.

Defatult: False.

SwitchParameter

False

Named

False

GuestCredentials

Specifies the credentials of the target machine.

Note: If you do not specify credentials, the cmdlet will try to use the credentials from the current PowerShell session.

Accepts the CCredentials object. To create this object, run the Get-VBRCredentials cmdlet.

False

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see the About CommonParameters section of Microsoft Docs.

Output Object

None.

Examples

Copying Microsoft Windows Guest OS Files to Target Folder

This example shows how to copy files from the backup of the WinSrv25 Windows machine to the "D:\Copies" folder. The cmdlet will keep all custom permissions and ownership of the copied files.

$backup = Get-VBRBackup -Name "WinSrv25"

$restorepoint = Get-VBRRestorePoint -Backup $backup -Name "Production VM"

Start-VBRWindowsFileRestore -RestorePoint $restorepoint

$session = Get-VBRRestoreSession

$items = Get-VBRWindowsGuestItem -Session $session -Name "Reports"

Copy-VBRWindowsGuestItem -Item $items -TargetFolder "D:\Copies" -Session $session -KeepPermissionsAndOwnership -RunAsync

Perform the following steps:

  1. Get the restore session.
  1. Run the Get-VBRBackup cmdlet. Specify the Name parameter value. Save the result to the $backup variable
  2. Run the Get-VBRRestorePoint cmdlet. Specify the Backup and Name parameter values. Save the result to the $restorepoint variable.
  3. Run the Start-VBRWindowsFileRestore cmdlet. Specify the RestorePoint parameter value. Save the result to the $flerestore variable.
  4. Run the Get-VBRRestoreSession cmdlet. Save the result to the $session variable.
  1. Run the Get-VBRWindowsGuestItem cmdlet. Specify the Session and Name parameter values. Save the result to the $item variable.
  2. Run the Copy-VBRWindowsGuestItem cmdlet. Specify the following settings:
  • Set the $item variable as the Item parameter value.
  • Specify the TargetFolder parameter value.
  • Set the $session variable as the Session parameter value.
  • Provide the KeepPermissionsAndOwnership parameter.
  • Provide the RunAsync parameter.

Related Commands