---
title: "PowerShell Test-Connection: The Modern Ping Test"
description: "Master PowerShell test-connection, a cmdlet for performing the popular ping test to remote hosts in a modern way."
canonical: "https://adamtheautomator.com/powershell-test-connection/"
---

# PowerShell Test-Connection: The Modern Ping Test

> Master PowerShell test-connection, a cmdlet for performing the popular ping test to remote hosts in a modern way.

Source: https://adamtheautomator.com/powershell-test-connection/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![PowerShell Test-Connection: The Modern Ping Test](https://adamtheautomator.com/wp-content/uploads/2019/06/5d238ae5c824b514689ea53e.jpg)

# PowerShell Test-Connection: The Modern Ping Test

[![](https://secure.gravatar.com/avatar/d0b9d42e21e5622713f8b693aa5c0f9244d5f7dd200ed29b8398f52dee5de337?s=192&d=mm&r=g)Adam Bertram](https://adamtheautomator.com/author/adam-bertram/)17 June 20192 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[PowerShell](/tag/powershell/)

Table of Contents

*   [PowerShell Test-Connection’s Object Output](#test-connection-s-object-output)
*   [Using Background Jobs](#using-background-jobs)
*   [Keeping it Simple](#keeping-it-simple)

Today’s cmdlet of the day is PowerShell Test-Connection. `Test-Connection` is a cmdlet that not surprisingly tests your network connection. Think of `Test-Connection` as PowerShell’s implementation of the popular ping utility. Even though both have ICMP in common, you’ll see that the two methods are a little different under the covers.

Using this cmdlet is simple. At its most basic, just specify a `ComputerName` parameter, and it will send four ICMP requests to the destination host.

```powershell
PS> Test-Connection -ComputerName google.com
Source        Destination     IPV4Address      IPV6Address                              Bytes    Time(ms)
------        -----------     -----------      -----------                              -----    --------
MACWINVM      google.com      172.217.0.14     2607:f8b0:4009:80c::200e                 32       47
MACWINVM      google.com      172.217.0.14     2607:f8b0:4009:80c::200e                 32       90
MACWINVM      google.com      172.217.0.14     2607:f8b0:4009:80c::200e                 32       88
MACWINVM      google.com      172.217.0.14     2607:f8b0:4009:80c::200e                 32       205
```

This output looks similar to _ping.exe_ and, on the surface, it is but Powershell test-connection issues the ICMP request a little differently. Unlike _ping.exe_, `Test-Connection` is using the local computer’s WMI class _Win32\_PingStatus_ to send the ICMP request. Using the local WMI repository means you’d better be sure your _local_ WMI repository is healthy else `Test-Connection` will not work.

## PowerShell Test-Connection’s Object Output

Also, as with the beauty of [PowerShell,](https://adamtheautomator.com/tag/powershell/) this cmdlet doesn’t merely return what immediately shows up in the console. We see rich objects that we can gather more information from.

If I assign the output to a variable and then check out the properties, you can see that I’ve gathered a lot more useful information.

```powershell
PS> $pingResults | Get-Member
TypeName: System.Management.ManagementObject#root\cimv2\Win32_PingStatus
Name                           MemberType     Definition
----                           ----------     ----------
PSComputerName                 AliasProperty  PSComputerName = __SERVER
Address                        Property       string Address {get;set;}
BufferSize                     Property       uint32 BufferSize {get;set;}
NoFragmentation                Property       bool NoFragmentation {get;set;}
PrimaryAddressResolutionStatus Property       uint32
PrimaryAddressResolutionStatus {get;set;}
ProtocolAddress                Property       string ProtocolAddress {get;set;}
ProtocolAddressResolved        Property       string
ProtocolAddressResolved {get;set;}
RecordRoute                    Property       uint32 RecordRoute {get;set;}
ReplyInconsistency             Property       bool ReplyInconsistency {get;set;}
ReplySize                      Property       uint32 ReplySize {get;set;}
ResolveAddressNames            Property       bool ResolveAddressNames {get;set;}
ResponseTime                   Property       uint32 ResponseTime {get;set;}
ResponseTimeToLive             Property       uint32 ResponseTimeToLive {get;set;}
RouteRecord                    Property       string[] RouteRecord {get;set;}
RouteRecordResolved            Property       string[] RouteRecordResolved {get;set;}
SourceRoute                    Property       string SourceRoute {get;set;}
SourceRouteType                Property       uint32 SourceRouteType {get;set;}
StatusCode                     Property       uint32 StatusCode {get;set;}
Timeout                        Property       uint32 Timeout {get;set;}
TimeStampRecord                Property       uint32[] TimeStampRecord {get;set;}
TimeStampRecordAddress         Property       string[] TimeStampRecordAddress {get;set;} TimeStampRecordAddressResolved Property       string[]
TimeStampRecordAddressResolved {get;set;}
TimestampRoute                 Property       uint32 TimestampRoute {get;set;}
<SNIP>
```

If you’re testing internal hosts, `Test-Connection` will use DCOM to authenticate to remote hosts. By default, it will use [Packet level DCOM authentication](https://learn.microsoft.com/en-us/dotnet/api/system.management.authenticationlevel?redirectedfrom=MSDN&view=dotnet-plat-ext-6.0) but the authentication type can always be changed with the `DcomAuthentication` parameter.

## Using Background Jobs

This cmdlet can also run as a background job. Background jobs come in handy if you’ve got lots of remote computers to ping and rather than wait forever for ones that’ll eventually time out, just send it to a background job.

According to the PowerShell help for Powershell test-connections, it says that [PowerShell remoting must be enabled](https://learn.microsoft.com/en-us/previous-versions/technet-magazine/ff700227\(v=msdn.10\)?redirectedfrom=MSDN) on both the local and remote computers, but this is not true. As you can see below, I’m testing google.com, and the command still works great.

![Test-Connection -AsJob -ComputerName google.com](https://adamtheautomator.com/content/images/2019/07/test-connection-ping-powershell---image-10.png)

Test-Connection -AsJob -ComputerName google.com

![Get-Job | Receive-Job](https://adamtheautomator.com/content/images/2019/07/test-connection-ping-powershell---image-11.png)

Get-Job | Receive-Job

## Keeping it Simple

Finally, if you’re just looking for a binary yes/no answer to if a computer is responding or not, you can always use the `Quiet` parameter. A common string I always use to quickly see if a server is online or not is to use `Quiet` and `Count` of 1 to force `Test-Connection` to send a single ICMP request.

```powershell
PS> Test-Connection -ComputerName google.com -Quiet -Count 1
True
```

That’s it for our cmdlet of the day! We covered the majority of what’s possible with Powershell test-connection but, as always, check out the PowerShell help content or head over to the [Microsoft documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/test-connection?view=powershell-5.1) for a full breakdown.

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-test-connection%2F&text=PowerShell%20Test-Connection%3A%20The%20Modern%20Ping%20Test)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-test-connection%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fpowershell-test-connection%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/06/26995-troubleshoot-dns-issues-powershell-codex.webp)

### [Troubleshoot DNS Issues with PowerShell](/troubleshoot-dns-issues-powershell/)

Troubleshoot DNS issues with PowerShell by testing name resolution, DNS client settings, cache entries, and network connectivity in a repeatable workflow.

![](https://adamtheautomator.com/wp-content/uploads/2025/10/image_2025-10-24_095322075.png)

### [Migrating from PowerShell 6 to 7.5: Breaking Changes/New Features](/migrating-powershell-6-to-7-5/)

Migrate from PowerShell Core 6 to 7.5: breaking changes, features, and testing tips.

![](https://adamtheautomator.com/wp-content/uploads/2025/06/featured-image-6.png)

### [How to Add Timeouts to Pester Tests with PowerShell Runspaces](/pester-test-timeout-runspaces/)

Prevent Pester tests from hanging indefinitely using PowerShell runspaces. Learn to handle variable scoping, module loading, TestDrive access, and stream capture challenges with timeout protection.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
