Windows PowerShell equivalents for common networking commands


For Windows System Administrator, Network troubleshooting is a part of the system troubleshooting. Maybe you need to check the IP address of a machine or test if its networking connection is working. Maybe you need to see if DNS is properly configured or check the latency between two hosts.

You can run the command [cc]Get-Command -Module Net* | Group Module[/cc] to check all the Network command available on your PowerShell. But more important than knowing every one of them, is to know the most useful cmdlets that have the potential to replace those old commands that you can’t live without.


Below is Windows Powershell equivalents for some networking commands:

Description: This command has many options, but the most common usage is just to show the IP address, subnet mask and default gateway for each network adapter in a machine.

PowerShell: Get-NetIPConfiguration or Get-NetIPAddress

Sample command lines:

Get-NetIPAddress | Sort InterfaceIndex | FT InterfaceIndex, InterfaceAlias, AddressFamily, IPAddress, PrefixLength -Autosize
Get-NetIPAddress | ? AddressFamily -eq IPv4 | FT –AutoSize
Get-NetAdapter Wi-Fi | Get-NetIPAddress | FT -AutoSize


Description: Checks connectivity to a specific host. Commonly used to check for liveliness, but also used to measure network latency.

PowerShell: Test-NetConnection

Sample command lines:

Test-NetConnection -ComputerName -InformationLevel Detailed
Test-NetConnection -ComputerName | Select -ExpandProperty PingReplyDetails | FT Address, Status, RoundTripTime
1..10 | % { Test-NetConnection -ComputerName -RemotePort 80 } | FT -AutoSize


Description: Name server lookup. Mostly used to find the IP address for a given DNS name (or vice-versa). Has many, many options.

PowerShell: Resolve-DnsName

Sample command lines:

Resolve-DnsName -type SOA
Resolve-DnsName -Server –Type A


route print
Description: The Get-NetRoute cmdlet gets IP route information from the IP routing table, including destination network prefixes, next hop IP addresses, and route metrics. Run this cmdlet without any parameters to get all IP routes from the routing table.

PowerShell: Get-NetRoute

Sample command lines:

Get-NetRoute | Format-List -Property *
Get-NetRoute -AddressFamily IPv6
Get-NetRoute -InterfaceIndex 12
Get-NetRoute -DestinationPrefix "" | Select-Object -ExpandProperty "NextHop"
Get-NetRoute | Where-Object -FilterScript { $_.NextHop -Ne "::" } | Where-Object -FilterScript { $_.NextHop -Ne "" } | Where-Object -FilterScript { ($_.NextHop.SubString(0,6) -Ne "fe80::") }
Get-NetRoute | Where-Object -FilterScript {$_.NextHop -Ne "::"} | Where-Object -FilterScript { $_.NextHop -Ne "" } | Where-Object -FilterScript { ($_.NextHop.SubString(0,6) -Ne "fe80::") } | Get-NetAdapter
Get-NetRoute | Where-Object -FilterScript { $_.ValidLifetime -Eq ([TimeSpan]::MaxValue) }


Please enter your comment!
Please enter your name here