PowerShell Equivalent Cmdlets for IPConfig, PING, and NSLookup

If you have been in the field long enough, you probably have a number of favorite command lines that you learned and use on a regular basis and that probably includes IPConfig, Ping, and NSLookup. While we are moving into the PowerShell realm, it’s nice to know what the equivalents are in PowerShell for these 3 popular network command lines.

IPCONFIG

If you are using IPConfig for showing IP address info for each network adapter installed on a Windows computer, here are 2 PowerShell cmdlets that do the similar functions.

Get-NetIPConfiguration or Get-NetIPAddress

Windows PowerShell - 2016-02-18 23_46_47

Get-NetIPConfiguration cmdlet gets network configuration for each available network adapter found on one computer while Get-NetIPAddress gets the entire IP address configuration for the computer which could pull out a long list of IP addresses in the result. So the former works a bit more similar to IPConfig than the latter.

PING

The equivalent in PowerShell is Test-NetConnection cmdlet that displays diagnostic information for a connection. The output includes the results of a DNS lookup, a listing of IP interfaces, an option to test a TCP connection, IPsec rules, and confirmation of connection establishment.

Windows PowerShell - 2016-02-18 23_58_54

Noticed the last command line in the above screenshot? Using Test-NetConnection with the -TraceRoute parameter shows the IP route to a host, including all the hops between your computer and that host. A complete equivalent to Tracert command line, isn’t it?

NSLOOKUP

The equivalent in PowerShell is Resolve-DnsName cmdlet that performs a DNS query for the specified name. One of the nice things to use this PowerShell equivalent is that you can specify a different DNS server to perform the DNS lookup, very useful when doing the DNS related network troubleshoot.

Windows PowerShell - 2016-02-19 00_09_17

That’s it for now…hope it helps.

Kent Chen

Microsoft MVP, IT Professional, Developer, Geek, and the co-founder of Next of Windows.

Last updated: 02/19/2016

Posted in: Tips & Tricks
Discover more: , , , ,