--- title: "New-VBRRestoreNetworkMappingRule" 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-vbrrestorenetworkmappingrule.html" breadcrumb: "Veeam PowerShell Reference > Veeam PowerShell Reference > Data Recovery > Microsoft Active Directory Forest Recovery > New-VBRRestoreNetworkMappingRule" dateModified: "2026-11-09" --- # New-VBRRestoreNetworkMappingRule ## Short Description Creates a VMware network mapping rule for a Microsoft Active Directory forest recovery. **Platform**: VMware **Product Edition**: Standard, Enterprise, Enterprise Plus, Veeam Universal License ## 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 to VMware vSphere. The `New-VBRRestoreNetworkMappingRule` cmdlet is an alias for the [`New-VBRViInstantRecoveryNetworkMappingRule`](new-vbrviinstantrecoverynetworkmappingrule.md) cmdlet. To create a network mapping rule for Microsoft Hyper-V, run the [`New-VBRHvInstantRecoveryNetworkMappingRule`](new-vbrhvinstantrecoverynetworkmappingrule.md) cmdlet. ## Parameters `` 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 for Entire 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-VBRRestoreNetworkMappingRule -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-VBRRestoreNetworkMappingRule` 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 the [`Start-VBRADForestRestore`](start-vbradforestrestore.md) cmdlet. ::: ::: example ### Example 2. Creating Network Mapping Rule for Partial Forest Recovery This example shows how to create a network mapping rule and use it in a VMware domain controller recovery specification for a partial 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-VBRRestoreNetworkMappingRule -SourceNetwork $sourceNetwork -TargetNetwork $targetNetwork $resourcePool = Find-VBRViResourcePool -Server $server -Name "Resources" $datastore = Find-VBRViDatastore -Server $server -Name "Datastore01" $folder = Find-VBRViEntity -Server $server -Name "Discovered virtual machine" $dcSpec = New-VBRViADForestDcRestoreSpec -RestorePoint $domainRestorePoint[0] -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-VBRRestoreNetworkMappingRule` 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 [`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. 10. 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. 11. 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. 12. Run the [`New-VBRViADForestDcRestoreSpec`](new-vbrviadforestdcrestorespec.md) cmdlet. Specify the following parameters: - Set the `$domainRestorePoint[0]` variable as the `RestorePoint` 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 `$dcSpec` variable to use it with the [`New-VBRADForestPartialRestoreDomainSpec`](new-vbradforestpartialrestoredomainspec.md) cmdlet. ::: ## Related Commands - [`New-VBRViInstantRecoveryNetworkMappingRule`](new-vbrviinstantrecoverynetworkmappingrule.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-VBRHvInstantRecoveryNetworkMappingRule`](new-vbrhvinstantrecoverynetworkmappingrule.md) - [`New-VBRViADForestDcRestoreSpec`](new-vbrviadforestdcrestorespec.md) - [`New-VBRViADForestDomainRestoreSpec`](new-vbrviadforestdomainrestorespec.md)