If you are an IT admin, then I am sure you are using PING command everyday. In PowerShell we have an Test-Connection command which is a very good alternative of it. as we know PowerShell is an object based scripting language by using it we can do much more.

Whenever I/we have network or internet related issues we do "Ping google.com" to check the response time of website and then we can know how our internet is performing. Sometime rather then pinging one  website we do ping few more website.

So i was thinking that if i can ping multiple servers in one time and get there average as as result. I don't want an fancy script just a simple script which i can run from my PowerShell console and view the result there.

So i just create a simple PowerShell script which can do this for us.

To know more about this script visit this link :  http://newdelhipowershellusergroup.blogspot.in/2012/03/get-average-ping-response-time-of.html

 

Best Regards!

Aman Dhally 

Come and join my journey of 100 Days of Self Improvement programme: https://www.facebook.com/100DoSI or at www.amandhally.net   

MY PowerShell Blog : http://newdelhipowershellusergroup.blogspot.com/ 

MY Personal Website: www.amandhally.net

 

PowerShell
Edit|Remove
#+-------------------------------------------------------------------+   
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = |   
#|{>/-------------------------------------------------------------\<}|            
#|: | Author:  Aman Dhally                                                    
#| :| Email:   amandhally@gmail.com                           
#|: | Purpose:                                                         
#| :|       Ping Multiple Server and get an Average Ping time .  
#|: |  Blog: http://newdelhipowershellusergroup.blogspot.com/                                                            
#|: |                                Date: 16-03-2012            
#| :|                     /^(o.o)^\    Version: 1         
#|{>\-------------------------------------------------------------/<}| 
#| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = | 
#+-------------------------------------------------------------------+ 
 
### Inculde other Script files 
 
 
$CompName = "dc-Local","google.com","rediff.com","yahoo.com" 
 
foreach ($comp in $CompName) { 
     
    $test = (Test-Connection -ComputerName $comp -Count 4  | measure-Object -Property ResponseTime -Average).average 
    $response = ($test -as [int] ) 
         
    write-Host "The Average response time for" -ForegroundColor Green -NoNewline;write-Host " `"$comp`" is " -ForegroundColor Red -NoNewline;;Write-Host "$response ms" -ForegroundColor Black -BackgroundColor white 
       
} 
 
##### End of the script ####