

Example #4 – Test-Connection with -Quiet parameter. If we keep the default parameter, it counts for 4, and checking remote connectivity for multiple servers will take more than the expected time. This parameter is generally used when we test connections for multiple computers. Test-Connection -ComputerName LabMachine2k12 -Count 2 The default number of responses we receive from remote computers is 4. We can specify the number of counts we need to receive as a response from the remote computer using the -Count Parameter. Example #3 – Test-Connection with -Count parameter. You can check the ComputerName parameter is a String array parameter. Help Test-Connection -Parameter ComputerName To check the connectivity of the multiple remote computers, we can provide the multiple computer names for the -ComputerName parameter because this parameter accepts the string array. Example #2 – Test-Connection for multiple remote computers. In the above example, Source mentions the originated machine, the destination is the remote computer, IP address is the remote computer IP.įor PowerShell core version (version 6.0+) ComputerName parameter is renamed to TargentName. Test-Connection -ComputerName LabMachine2k12 This example simply explains remote connectivity. Examplesĭifferent examples are mentioned below: Example #1 – Test-Connection for a remote computer. This command is far better than the ping command as we can play with the different parameters like we can specify the number of count in response, can send requests for the multiple servers, set the buffer size and MTU limit, etc.

Many times remote computers are online, but they cannot respond due to the above-mentioned reasons.

Remote computer response depends on offline, their firewall rules, network security rules, etc. This command’s sole purpose is to check if the remote computers are online or not by sending them ICMP requests to the remote hosts. How does the Test-Connection command work in PowerShell? For example, We can’t use Mtusize and TraceRoute parameters together. Please note: We need to use a single pair at a time as a syntax. Hadoop, Data Science, Statistics & others
