Powershell test-connection hangs

Viewed 1116

I am experiencing a problem running the Test-Connection command from one of my scripting servers. Simply running the command Test-Connection -ComputerName $Hostname -Count 1 -ErrorAction Stop hangs the powershell session. Running the ping command works as expected. The issue is specific to this one server I am running the command from. Other servers are running the command and returning the expected values. I know about Test-NetConnection and this works, however, I need to know the root cause why Test-Connection is hanging on this one server. Any advice is greatly appreciated.

1 Answers

Test-NetConnection is the successor of Test-Connection, it adds a few functionalities like port availability check and tracert functionality.

I would need to see the exact error to know if it is in fact a timeout issue, if so the default timeout for Test-Connection must be lower than Test-NetConnection or maybe its because Test-Connection uses only ICMP (Internet Control Message Protocol) and Test-NetConnection even though it can use this protocol if asked by parameter may not use it as the default protocol.

Related