Test-Connection is a very powerful PowerShell Cmdlet which sends ICMP Packets to test the reachability of a host. Like ping. But Test-Connection is much more. Let’s play with the new ping command.
Ping multiple Hosts
Unlike ping you can test the connection to multiple hosts. Separate them by comma.
Test-Connection www.sid-500.com,192.168.0.105
Shut Up Mode
The world is loud enough 😉 The following example shows how to run Test-Connection in Quiet Mode which results in suppressing details.
Test-Connection sid-500.com,192.168.0.105 -Quiet
True oder False. In this case both hosts are reachable.
Different Sources
When using ping the source is always localhost. But the good news is: You can specify a Source Computer.
Note, that i am logged on server03 as a member of the Domain-Admins group. I set the source to dc01 and ping server03. Reverse Ping 😉
Test-Connection -Source dc01 -Destination server03
By the way: ::1 is the IPv6 localhost address same as 127.0.0.0/8 in IPv4.
Further Information
Test-Connection tests the connectivity to a remote host. See also my blog post about Test-NetConnection: PowerShell: Playing with Test-NetConnection (ping, tracert, TCP Ports …)
For checking domain connectivity and name resolution see my articles
Checking connectivity to Active Directory: Test-ComputerSecureChannel and
The new nslookup: Resolve-DnsName
Categories: PowerShell, Windows Server
Hi Vignesh!
Unfortunately, I cannot give you an advice. For me, I love automation with PowerShell. It’s a built-in feature on every windows system. Python could be also very interesting.
Regards,
P
LikeLike
Hi timbojill,
Thank you for your comment in power shell.
I am working as network operations since last 3+ years and recently i was moved to be automations team in company.
so here is we are using puppet tool for automations and i have no idea about the scripts in shell & python.
i have doubt about this field due to how this automaition is good compare to my network ops.
is it good or bad for my career growth?
-Vignesh
LikeLike
Are there any equivalent commands for Windows 10 command prompt? Kindly let me know.
LikeLike
Hi, timbojill!
Thank you for your comment.
In PowerShelll, you can use Test-Connection and Test-NetConnection.
In command prompt, ping ist the only out-of-the box command.
Regards,
P
LikeLike