Have you ever or still use any of this commands to troubleshoot ? Ping, Telnet, NSlookup, Tracert. Did you know there are PowerShell cmdlets that can do all that and better ?
YOUR NEW FRIEND TEST-CONNECTION
Before give you an example of telnet have you ever got this error “‘Telnet’ is not recognized as internal or external command, operable program or batch file”
Well this should be a thing of the past and there is no need to install telnet client on your machine.
There are two important things here, first pay attention to TcpTestSucceeded and look out for the True value. This cmdlet will also do ping and show a status of true or false next to PingSucceded
Let me show you an output when the port is close
As you can see the TcpTestSuceeded is equal false and you will get a warning message that TCP connect failed. Also take note that PingSucceded is true because ICMP stills works on http://www.powershell.org.
Let use Test-NetConnection again and just add the -TraceRoute parameter
I think you get a cleaner output and it is faster to execute it. Test-NetConnection only took 4.3 seconds to complete and tracert took 50 seconds.
I usually use nslookup to find A records resolution and/or mx records resolution. I will give you an example with mx records
To find information about mx records I always had to type nslookup then wait like 2 seconds, then set type=mx and finally type the domain name.
Now let me show you a simpler way using Resolve-DNSName
I have to use one line to find that the mx record, simple enough. Now let’s say you need to find all txt records
Keep in mind these cmdlets are only available on Windows 2012 R2 or Windows 8.1 and higher.