--- title: "Set-VBRViVirtualDeviceMappingRule" description: "This cmdlet modifies mapping settings of backed-up virtual disks. To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameter values with new values." canonical: "https://helpcenter.veeam.com/docs/vbr/powershell/set-vbrvivirtualdevicemappingrule.html" breadcrumb: "Veeam PowerShell Reference > Veeam PowerShell Reference > Data Recovery > Virtual Disks Restore > Set-VBRViVirtualDeviceMappingRule" dateModified: "2026-08-19" --- # Set-VBRViVirtualDeviceMappingRule ## Short Description Modifies backed-up virtual disk mapping settings. **Product Edition**: Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` Set-VBRViVirtualDeviceMappingRule -MappingRule [-SourceVirtualDevice ] [-Datastore ] [] ``` ## Detailed Description This cmdlet modifies mapping settings of backed-up virtual disks. ::: note To modify settings, specify new values for the necessary parameters. The cmdlet will overwrite the previous parameter values with new values. The parameters that you omit will remain unchanged. ::: ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Datastore

Specifies a datastore. The cmdlet will map backed-up virtual disks to this datastore.

Accepts the CViDatastoreItem object. To create this object, run the Find-VBRViDatastore cmdlet.

CViDatastoreItem

False

Named

False

MappingRule

Specifies the mapping settings that you want to modify.

Accepts the VBRViVirtualDeviceMappingRule object. To define this object, run the New-VBRViVirtualDeviceMappingRule cmdlet.

VBRViVirtualDeviceMappingRule

True

Named

True (ByPropertyName, ByValue)

SourceVirtualDevice

Specifies backed-up virtual disks. The cmdlet will map these disks to the datastore.

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

VBRViVirtualDevice

False

Named

False

`` This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see [ Microsoft Docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_commonparameters?view=powershell-7). ## Output Object The cmdlet returns the `VBRViVirtualDeviceMappingRule` object that defines backed-up virtual disks mapping settings. ## Examples ::: example ### Modifying Mapping Settings of Backed-Up Virtual Disks This example shows how to modify an existing mapping rule. The cmdlet will set this rule to map backed-up virtual disks to the `LocalStore_0` datastore. ``` $backup = Get-VBRBackup -Name "Winsrv4515" $restorepoint = Get-VBRRestorePoint -Backup $backup $disks = Get-VBRViVirtualDevice -RestorePoint $restorepoint[3] $mappingrule = New-VBRViVirtualDeviceMappingRule -SourceVirtualDevice $disks $server = Get-VBRServer -Name "WinSrv2073" $datastore = Find-VBRViDatastore -Server $server -Name "LocalStore_0" Set-VBRViVirtualDeviceMappingRule -MappingRule $mappingrule -Datastore $datastore ``` Perform the following steps: 1. Get the backed-up VM virtual disks: 1. Run the [`Get-VBRBackup`](get-vbrbackup.md) cmdlet. Specify the `Name` parameter value. Save the result to the `$backup` variable. 2. Run the [`Get-VBRRestorePoint`](get-vbrrestorepoint.md) cmdlet. Specify the `Backup` parameter value. Save the result to the `$restorepoint` variable. 3. Run the [`Get-VBRViVirtualDevice`](get-vbrvivirtualdevice.md) cmdlet. Specify the `RestorePoint` parameter value. Save the result to the `$disks` variable. The `Get-VBRRestorePoint` cmdlet will return an array of disks. Consider that the array numbering starts with 0. In our example, the fourth restore point will be used. 2. Run the [`New-VBRViVirtualDeviceMappingRule`](new-vbrvivirtualdevicemappingrule.md) cmdlet. Set the `$disks` variable as the `SourceVirtualDevice` parameter value. Save the result to the `$mappingrule` variable. 3. Get the datastore: 1. Run the [`Get-VBRServer`](get-vbrserver.md) cmdlet. Specify the `Name` parameter value. Save the result to the `$server` variable. 2. Run the [`Find-VBRViDatastore`](find-vbrvidatastore.md) cmdlet. Specify the `Name` and `Server` parameter values. Save the result to the `$datastore` variable. 4. Run the `Set-VBRViVirtualDeviceMappingRule` cmdlet. Set the `$mappingrule` variable as the `MappingRule` parameter value. Set the `$datastore` variable as the `Datastore` parameter value. ::: ## Related Commands - [`Get-VBRBackup`](get-vbrbackup.md) - [`Get-VBRRestorePoint`](get-vbrrestorepoint.md) - [`Get-VBRViVirtualDevice`](get-vbrvivirtualdevice.md) - [`Get-VBRServer`](get-vbrserver.md) - [`Find-VBRViDatastore`](find-vbrvidatastore.md) - [`New-VBRViVirtualDeviceMappingRule`](new-vbrvivirtualdevicemappingrule.md)