question

Sean-5575 avatar image
0 Votes"
Sean-5575 asked RichMatheisen-8856 commented

Bug in Test-NetConnection gives both "PingSucceeded: False" and "TcpTestSucceeded : True" but "PingSucceeded: True" without -Port

On Windows 10 using Powershell 5.1 the Test-NetConnection looks like it has a bug when invoked using the -Port parameter. The cmdlet Test-NetConnection gives both "PingSucceeded: False" and "TcpTestSucceeded : True" despite the fact the target host does respond to ICMP-- however when provided only -Computername $IPAddress then it returns "PingSucceeded: True" which is correct. It appears that a successful result when using -Port affects how the cmdlet reports PingSucceeded. When the port is closed, then it reports "PingSucceeded: True" This behavior happens when using either IP address or FQDN for -Computername. Can anyone confirm if this is by design? Seems more like a bug.

windows-server-powershell
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I've always looked at that as a feature.

If I test a port and it fails I don't know if the machine's down or it's just not accepting a connection on that port. If the results show that ping succeeded then at least I know the machine's at least somewhat functional. OTOH, if the TCP test worked I seldom care if ICMP echo works because that's often blocked or dropped (plus the ICMP echo is done only once and because UDP is unreliable it can give the impression the machine's not "there" even though it is if that one packet is lost).

I don't see anywhere on the page test-netconnection that both TCP and ICMP will be used in every instance. Of course it doesn't say that the won't, either. But watching what's happening with WireShark it matches what you describe and what I've witnessed.




0 Votes 0 ·

0 Answers