--- title: "New-VBRViInstantRecoveryNetworkMappingRule" description: "This cmdlet defines the VBRViInstantRecoveryNetworkMappingRule object. This object defines how to map a network in the original site to a network on the target site (site where VMs will be recovered)." canonical: "https://helpcenter.veeam.com/docs/vbr/powershell/new-vbrviinstantrecoverynetworkmappingrule.html" breadcrumb: "Veeam PowerShell Reference > Veeam PowerShell Reference > Data Recovery > Instant Recovery > New-VBRViInstantRecoveryNetworkMappingRule" dateModified: "2026-11-06" --- # New-VBRViInstantRecoveryNetworkMappingRule ## Short Description Creates a new network mapping rule. **Platform**: VMware **Product Edition**: Standard, Enterprise, Enterprise Plus, Veeam Universal License ## Syntax ``` New-VBRViInstantRecoveryNetworkMappingRule -SourceNetwork -TargetNetwork [] ``` ## Detailed Description This cmdlet defines the `VBRViInstantRecoveryNetworkMappingRule` object. This object defines how to map a network in the original site to a network on the target site (site where VMs will be recovered). You can use this object to specify network mapping when you recover a Microsoft Active Directory forest. The [`New-VBRRestoreNetworkMappingRule`](new-vbrrestorenetworkmappingrule.md) cmdlet is an alias for the `New-VBRViInstantRecoveryNetworkMappingRule` cmdlet. ## Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

SourceNetwork

Specifies the network to which the source machine was connected in the original site.

Accepts the VBRComputerNetworkInfo object. To get this object, run the Get-VBRComputerNetworkInfo cmdlet.

VBRComputerNetworkInfo

True

Named

False

TargetNetwork

Specifies the virtual network connected to the VMware host which machines are recovered to.

Accepts the VBRViNetworkInfo object. To get this object, run the Get-VBRViServerNetworkInfo cmdlet.

VBRViNetworkInfo

True

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 `VBRViInstantRecoveryNetworkMappingRule` object that defines network mapping rules. ## Examples ::: example ### Example 1. Creating Network Mapping Rule This example shows how to define a network mapping rule for a VMware environment. ``` $restorePoint = Get-VBRRestorePoint -Name "srv01.tech.local" | Sort-Object CreationTime | Select-Object -Last 1 $server = Get-VBRServer -Name "esx01.tech.local" $sourceNetwork = Get-VBRComputerNetworkInfo -RestorePoint $restorePoint | Where-Object { $_.Name -eq "VM Network" } $targetNetwork = Get-VBRViServerNetworkInfo -Server $server | Where-Object { $_.NetworkName -eq "Restore Network" } $rule = New-VBRViInstantRecoveryNetworkMappingRule -SourceNetwork $sourceNetwork -TargetNetwork $targetNetwork ``` Perform the following steps: 1. Run the [`Get-VBRRestorePoint`](get-vbrrestorepoint.md) cmdlet. Specify the `Name` parameter value. Sort the result by creation time, select the latest restore point, and save it to the `$restorePoint` variable. 2. Run the [`Get-VBRServer`](get-vbrserver.md) cmdlet. Specify the `Name` parameter value. Save the result to the `$server` variable. 3. Run the [`Get-VBRComputerNetworkInfo`](get-vbrcomputernetworkinfo.md) cmdlet. Set the `$restorePoint` variable as the `RestorePoint` parameter value. Filter the result by the network name. Save the result to the `$sourceNetwork` variable. 4. Run the [`Get-VBRViServerNetworkInfo`](get-vbrviservernetworkinfo.md) cmdlet. Set the `$server` variable as the `Server` parameter value. Filter the result by the network name. Save the result to the `$targetNetwork` variable. 5. Run the `New-VBRViInstantRecoveryNetworkMappingRule` cmdlet. Set the `$sourceNetwork` variable as the `SourceNetwork` parameter value. Set the `$targetNetwork` variable as the `TargetNetwork` parameter value. Save the result to the `$rule` variable. ::: ::: example ### Example 2. Creating Network Mapping Rule for Microsoft Active Directory Forest Recovery This example shows how to create a network mapping rule and use it in a VMware domain recovery specification for an entire Microsoft Active Directory forest recovery. ``` $forest = Get-VBRADForest $domain = Get-VBRADForestDomain -ADForest $forest $domainRestorePoint = Get-VBRADForestDomainRestorePoint -Domain $domain $restorePoint = Get-VBRRestorePoint -Id $domainRestorePoint[0].Id $server = Get-VBRServer -Name "esx01.tech.local" $sourceNetwork = Get-VBRComputerNetworkInfo -RestorePoint $restorePoint | Where-Object { $_.Name -eq "VM Network" } $targetNetwork = Get-VBRViServerNetworkInfo -Server $server | Where-Object { $_.NetworkName -eq "Restore Network" } $rule = New-VBRViInstantRecoveryNetworkMappingRule -SourceNetwork $sourceNetwork -TargetNetwork $targetNetwork $credentials = Get-Credential $resourcePool = Find-VBRViResourcePool -Server $server -Name "Resources" $datastore = Find-VBRViDatastore -Server $server -Name "Datastore01" $folder = Find-VBRViEntity -Server $server -Name "Discovered virtual machine" $viSpec = New-VBRViADForestDomainRestoreSpec -RestorePoint $domainRestorePoint[0] -Credentials $credentials -Server $server -ResourcePool $resourcePool -Datastore $datastore -Folder $folder -VMName "DC01-Restored" -NetworkMapping $rule ``` Perform the following steps: 1. Run the [`Get-VBRADForest`](get-vbradforest.md) cmdlet. Save the result to the `$forest` variable. 2. Run the [`Get-VBRADForestDomain`](get-vbradforestdomain.md) cmdlet. Set the `$forest` variable as the `ADForest` parameter value. Save the result to the `$domain` variable. 3. Run the [`Get-VBRADForestDomainRestorePoint`](get-vbradforestdomainrestorepoint.md) cmdlet. Set the `$domain` variable as the `Domain` parameter value. Save the result to the `$domainRestorePoint` variable. The cmdlet returns an array of restore points (points in time); this example uses the first one (`$domainRestorePoint[0]`). 4. Run the [`Get-VBRRestorePoint`](get-vbrrestorepoint.md) cmdlet. Set the ID of the `$domainRestorePoint[0]` restore point as the `Id` parameter value. Save the result to the `$restorePoint` variable. 5. Run the [`Get-VBRServer`](get-vbrserver.md) cmdlet. Specify the `Name` parameter value. Save the result to the `$server` variable. 6. Run the [`Get-VBRComputerNetworkInfo`](get-vbrcomputernetworkinfo.md) cmdlet. Set the `$restorePoint` variable as the `RestorePoint` parameter value. Filter the result by the network name. Save the result to the `$sourceNetwork` variable. 7. Run the [`Get-VBRViServerNetworkInfo`](get-vbrviservernetworkinfo.md) cmdlet. Set the `$server` variable as the `Server` parameter value. Filter the result by the network name. Save the result to the `$targetNetwork` variable. 8. Run the `New-VBRViInstantRecoveryNetworkMappingRule` cmdlet. Set the `$sourceNetwork` variable as the `SourceNetwork` parameter value. Set the `$targetNetwork` variable as the `TargetNetwork` parameter value. Save the result to the `$rule` variable. 9. Run the [`Get-Credential`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-7.1) cmdlet. Save the result to the `$credentials` variable. 10. Run the [`Find-VBRViResourcePool`](find-vbrviresourcepool.md) cmdlet. Set the `$server` variable as the `Server` parameter value. Specify the `Name` parameter value. Save the result to the `$resourcePool` variable. 11. Run the [`Find-VBRViDatastore`](find-vbrvidatastore.md) cmdlet. Set the `$server` variable as the `Server` parameter value. Specify the `Name` parameter value. Save the result to the `$datastore` variable. 12. Run the [`Find-VBRViEntity`](find-vbrvientity.md) cmdlet. Set the `$server` variable as the `Server` parameter value. Specify the `Name` parameter value. Save the result to the `$folder` variable. 13. Run the [`New-VBRViADForestDomainRestoreSpec`](new-vbrviadforestdomainrestorespec.md) cmdlet. Specify the following parameters: - Set the `$domainRestorePoint[0]` variable as the `RestorePoint` parameter value. - Set the `$credentials` variable as the `Credentials` parameter value. - Set the `$server` variable as the `Server` parameter value. - Set the `$resourcePool` variable as the `ResourcePool` parameter value. - Set the `$datastore` variable as the `Datastore` parameter value. - Set the `$folder` variable as the `Folder` parameter value. - Specify the `VMName` parameter value. - Set the `$rule` variable as the `NetworkMapping` parameter value. Save the result to the `$viSpec` variable to use it with other cmdlets. ::: ## Related Commands - [`New-VBRRestoreNetworkMappingRule`](new-vbrrestorenetworkmappingrule.md) - [`Find-VBRViDatastore`](find-vbrvidatastore.md) - [`Find-VBRViEntity`](find-vbrvientity.md) - [`Find-VBRViResourcePool`](find-vbrviresourcepool.md) - [`Get-Credential`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-7.5) - [`Get-VBRADForest`](get-vbradforest.md) - [`Get-VBRADForestDomain`](get-vbradforestdomain.md) - [`Get-VBRADForestDomainRestorePoint`](get-vbradforestdomainrestorepoint.md) - [`Get-VBRComputerNetworkInfo`](get-vbrcomputernetworkinfo.md) - [`Get-VBRRestorePoint`](get-vbrrestorepoint.md) - [`Get-VBRServer`](get-vbrserver.md) - [`Get-VBRViServerNetworkInfo`](get-vbrviservernetworkinfo.md) - [`New-VBRViADForestDcRestoreSpec`](new-vbrviadforestdcrestorespec.md) - [`New-VBRViADForestDomainRestoreSpec`](new-vbrviadforestdomainrestorespec.md)