Adds a routing domain and virtual subnets to a virtual network adapter.
Windows Server · Risk: High · Documentation Verified
Last verified: 2026-10-26
Microsoft Hyper-V reference: Adds a routing domain and virtual subnets to a virtual network adapter. The syntax and selected example below are adapted from the pinned Windows Server 2025 reference. Module availability, target configuration and delegated permissions determine whether it can run in your environment. Documentation and parameter text: Microsoft, CC BY 4.0; formatting adapted by Cmdlet World. No execution testing is claimed.
Use an account with the target resource permissions documented for Add-VMNetworkAdapterRoutingDomainMapping. Modifying administrative cmdlets may require elevation or delegated administration. This catalog does not assert that ordinary users can execute the command.
Supported environments
Windows / Hyper-V · Windows Server 2025 documentation; feature/module prerequisites apply
Parameters
-CimSession
Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.
-ComputerName
Specifies an array of Hyper-V hosts. The cmdlet adds the routing domain and virtual subnet to a virtual network adapter on the Hyper-V hosts that you specify.
-Confirm
Prompts you for confirmation before running the cmdlet.
-Credential
Specifies one or more user accounts that have permission to perform this action. The default is the current user.
-IsolationID (required)
Specifies an array of IDs of virtual subnets. The cmdlet adds the virtual subnets that you specify to the virtual network adapter. You can isolate a virtual machine adapter by using virtual local area network (VLAN), Hyper-V Network Virtualization, or a third party virtualization solution. For more information about isolation IDs, see the Set-VMNetworkAdapterIsolation cmdlet.
-IsolationName
Specifies an array of names of virtual subnets. The cmdlet adds the virtual subnets that you specify to the virtual network adapter. The subnet uses VLAN or Hyper-V Network Virtualization.
-ManagementOS (required)
Indicates that the cmdlet operates on the parent or host operating system.
-Passthru
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
-RoutingDomainID (required)
Specifies the ID of a routing domain. The ID of a routing domain is a system-assigned GUID. The cmdlet adds the routing domain that you specify to the virtual network adapter.
-RoutingDomainName (required)
Specifies the name of a routing domain. The cmdlet adds the routing domain that you specify to the virtual network adapter.
-VM (required)
Specifies an array of virtual machine objects. The cmdlet adds the routing domain to the network interfaces that belong to the virtual machines that you specify. To obtain a virtual machine object, use the Get-VM cmdlet.
-VMName (required)
Specifies an array of friendly names of virtual machines. The cmdlet adds the routing domain to the network interfaces that belong to the virtual machines that you specify.
-VMNetworkAdapter (required)
Specifies an array of virtual network adapter as VMNetworkAdapterBase objects. The cmdlet adds the routing domain on the adapters that you specify. To obtain a network adapter, use the Get-VMNetworkAdapter cmdlet.
-VMNetworkAdapterName
Specifies the name of a virtual network adapter. The cmdlet adds the routing domain on adapter that you specify.
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Prerequisites
Windows with the Hyper-V module and the Windows feature or management tools that provide it. Confirm target connectivity and version compatibility using the linked Microsoft reference.
Security considerations
This cmdlet changes system state. Review every target and parameter in the official reference, test outside production, and prepare an appropriate backup or rollback. Do not execute the example automatically.
Examples
Example 1: Add a tenant and virtual subnet to a multitenant virtual network
This command adds a tenant that has the specified routing domain to the virtual network adapter named Internal NIC that belongs to the multitenant virtual machine named Gateway01. The command also adds the virtual subnet that has the ID 6000 to the virtual network adapter. Source: Microsoft, CC BY 4.0; transcript prompt/output removed. This example was not executed.