Using Test-ConnectionAsync, you can ping many systems quickly by using an async method called SendPingAsync(). This allows for multiple pings being used at once and the operations are saved in Tasks that you can reference.

A blog post related to this subject can be found at: https://learn-powershell.net/2016/04/22/speedy-ping-using-powershell/

Remember to dot source the script file to load the function into the session.

 

PowerShell
Edit|Remove
. .\Test-ConnectionAsync.ps1
 
PowerShell
Edit|Remove
    <# 
        .SYNOPSIS 
            Performs a ping test asynchronously  
 
        .DESCRIPTION 
            Performs a ping test asynchronously 
 
        .PARAMETER Computername 
            List of computers to test connection 
 
        .PARAMETER Timeout 
            Timeout in milliseconds 
 
        .PARAMETER TimeToLive 
            Sets a time to live on ping request 
 
        .PARAMETER Fragment 
            Tells whether to fragment the request 
 
        .PARAMETER Buffer 
            Supply a byte buffer in request 
 
        .NOTES 
            Name: Test-ConnectionAsync 
            Author: Boe Prox 
            Version History: 
                1.0 //Boe Prox - 12/24/2015 
                    - Initial result 
 
        .OUTPUT 
            Net.AsyncPingResult 
 
        .EXAMPLE 
            Test-ConnectionAsync -Computername server1,server2,server3 
 
            Computername                Result 
            ------------                ------ 
            Server1                     Success 
            Server2                     TimedOut 
            Server3                     No such host is known 
 
            Description 
            ----------- 
            Performs asynchronous ping test against listed systems. 
    #>