PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Set-NetVirtualizationCustomerRoute', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Changes the metric value for virtual routes.


Set-NetVirtualizationCustomerRoute [-AsJob] [-CimSession <CimSession[]>] [-DestinationPrefix <String[]>] [-Metric <UInt32>] [-NextHop <String[]>] [-PassThru]
[-RoutingDomainID <String[]>] [-ThrottleLimit <Int32>] [-VirtualSubnetID <UInt32[]>] [<CommonParameters>]
Set-NetVirtualizationCustomerRoute [-AsJob] [-CimSession <CimSession[]>] [-Metric <UInt32>] [-PassThru] [-ThrottleLimit <Int32>] -InputObject <CimInstance[]>

Search powershellhelp.space


The Set-NetVirtualizationCustomerRoute cmdlet changes the metric value for virtual routes in a Microsoft® Hyper-V® Server 2012 virtual network. Network Virtualization allows
more than one virtual network to exist on the same physical network. Computers can exchange network traffic with a virtual machine (VM) by using a Customer Address within a
virtual network. Network Virtualization uses the metric to choose a preferred route from several possible routes. For more information, see Network Virtualization technical
details (http://technet.microsoft.com/library/jj134174.aspx) on TechNet.

You can use the Get-NetVirtualizationCustomerRoute cmdlet to get routes to modify, or you can use any combination of the following values to specify which routes to modify:

-- Destination prefix. A range of IP addresses as an IP prefix.
-- Next hop. A next hop gateway for the specified destionation addresses.
-- Routing domain ID. An ID for a virtual network that can include multiple virtual subnets.
-- Virtual subnet ID. An ID for a virtual subnet.



Online Version: http://go.microsoft.com/fwlink/?LinkId=289192




Example 1: Change a metric value

PS C:\>Set-NetVirtualizationCustomerRoute -DestinationPrefix "" -Metric 3

This command changes the metric value to 3 for a Customer Route that has the specified destination prefix.

Example 2: Change a metric value for mulitple Customer Routes

PS C:\>Get-NetVirtualizationCustomerRoute -NextHop "" | Set-NetVirtualizationCustomerRoute -Metric 3

This command uses the Get-NetVirtualizationCustomerRoute to get all the Customer Routes that have a next hop gateway of The command passes them by using the pipe
operator to the Set-NetVirtualizationCustomerRoute cmdlet, which changes the metric value to 3 for those Customer Routes.