Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Find-NetRoute

Windows Server 2012 R2 and Windows 8.1

Updated: October 17, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Find-NetRoute

Finds the best local IP address and the best route to reach a remote address.

Syntax

Parameter Set: Find0
Find-NetRoute -RemoteIPAddress <String> [-AsJob] [-CimSession <CimSession[]> ] [-InterfaceIndex <UInt32> ] [-LocalIPAddress <String> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]




Detailed Description

The Find-NetRoute cmdlet finds the best local IP address and the best route to reach a remote address. Specify the remote address to reach. You can also specify an interface and a local address to use to reach the remote address.

For more information about routing, see Chapter 5 - IP Routing (http://technet.microsoft.com/library/bb727001.aspx) in the TechNet library.

Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete. The cmdlet immediately returns an object that represents the job and then displays the command prompt. You can continue to work in the session while the job completes. To manage the job, use the *-Job cmdlets. To get the job results, use the Receive-Job cmdlet. For more information about Windows PowerShell® background jobs, see about_Jobs.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-CimSession<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.


Aliases

Session

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-InterfaceIndex<UInt32>

Specifies an index of a network interface. The cmdlet finds a route for this interface.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LocalIPAddress<String>

Specifies a local IP address from which to find a route. You can specify a host address or a subnet address. You can also use a wildcard address, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all addresses.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-RemoteIPAddress<String>

Specifies a remote IP address to which to find a route. You can specify a host address or a subnet address. You can also use a wildcard address, such as 0.0.0.0/0 for all IPv4 addresses, ::/0 for all IPv6 addresses, or ANY for all addresses


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ThrottleLimit<Int32>

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

Outputs

The output type is the type of the objects that the cmdlet emits.

  • NetIPAddress, NetRoute

Examples

Example 1: Find a local address and route

This command finds a NetIPAddress object and NetRoute object to use to access the IP address 10.79.197.200. The command returns two objects. The first object is the local IP address. The second object is the local route that includes the selected connectivity path and next hop.


PS C:\> Find-NetRoute -RemoteIPAddress "10.79.197.200"
IPAddress         : 172.31.234.140
InterfaceIndex : 3
InterfaceAlias : Ethernet
AddressFamily : IPv4
Type : Unicast
PrefixLength : 21
PrefixOrigin : Dhcp
SuffixOrigin : Dhcp
AddressState : Preferred
ValidLifetime : 6.00:10:40
PreferredLifetime : 6.00:10:40
SkipAsSource : False
PolicyStore : ActiveStore


Caption :
Description :
ElementName :
InstanceID : :8:8:8:9:55=55;A<8=;8<=<8;55;
AdminDistance :
DestinationAddress : IsStatic :
RouteMetric : 0
TypeOfRoute : 3
AddressFamily : IPv4
DestinationPrefix : 0.0.0.0/0
InterfaceAlias : Ethernet
InterfaceIndex : 3
NextHop : 172.31.232.1
PreferredLifetime : 8.00:00:00
Protocol : NetMgmt
Publish : No
Store : ActiveStore
ValidLifetime : 8.00:00:00
PSComputerName :
ifIndex : 3

Related topics

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.