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 <VBRComputerNetworkInfo>

-TargetNetwork <VBRViNetworkInfo> [<CommonParameters>]

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-VBRRestoreNetworkMappingRuleCreates a VMware network mapping rule for a Microsoft Active Directory forest recovery. cmdlet is an alias for the New-VBRViInstantRecoveryNetworkMappingRule cmdlet.

Parameters

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-VBRComputerNetworkInfoReturns networks connected to Veeam Agent computers. 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-VBRViServerNetworkInfoReturns virtual networks for a VMware host. cmdlet.

VBRViNetworkInfo

True

Named

False

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

The cmdlet returns the VBRViInstantRecoveryNetworkMappingRule object that defines network mapping rules.

Examples

New-VBRViInstantRecoveryNetworkMappingRuleExample 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-VBRRestorePointReturns restore points. 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-VBRServerReturns hosts connected to the backup infrastructure. cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  3. Run the Get-VBRComputerNetworkInfoReturns networks connected to Veeam Agent computers. 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-VBRViServerNetworkInfoReturns virtual networks for a VMware host. 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.

New-VBRViInstantRecoveryNetworkMappingRuleExample 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-VBRADForestReturns Microsoft Active Directory forests in your infrastructure. cmdlet. Save the result to the $forest variable.
  2. Run the Get-VBRADForestDomainReturns Active Directory domains within a forest or a restore point. cmdlet. Set the $forest variable as the ADForest parameter value. Save the result to the $domain variable.
  3. Run the Get-VBRADForestDomainRestorePointReturns restore points for an Active Directory domain. 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-VBRRestorePointReturns restore points. 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-VBRServerReturns hosts connected to the backup infrastructure. cmdlet. Specify the Name parameter value. Save the result to the $server variable.
  6. Run the Get-VBRComputerNetworkInfoReturns networks connected to Veeam Agent computers. 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-VBRViServerNetworkInfoReturns virtual networks for a VMware host. 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 cmdlet. Save the result to the $credentials variable.
  10. Run the Find-VBRViResourcePoolReturns VMware resource pools. 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-VBRViDatastoreLooks for VMware datastores. 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-VBRViEntityLooks for VMware objects. 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-VBRViADForestDomainRestoreSpecCreates a VMware domain recovery specification for an entire Microsoft Active Directory forest recovery. 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.

Page updated 2026-11-06

Page content applies to build 13.2.0.193