#+-------------------------------------------------------------------+ #| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = | #|{>/-------------------------------------------------------------\<}| #|: | Author: Aman Dhally | :| #| :| Email: amandhally@gmail.com #|: | Purpose: Ping Multiple Servers / Computers #|: | Date: 15-Nov-2011 #| :| /^(o.o)^\ Version: 1 |: | #|{>\-------------------------------------------------------------/<}| #| = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = : = | #+-------------------------------------------------------------------+ #### Provide the computer name in $computername variable $ServerName = "sql1.thegalaxy.local","LocalHost","dc1.thegalaxy.local","dc2.thegalaxy.local", "scsm-ms1.thegalaxy.local" ##### Script Starts Here ###### foreach ($Server in $ServerName) { if (test-Connection -ComputerName $Server -Count 2 -Quiet ) { write-Host "$Server is alive and Pinging " -ForegroundColor Green } else { Write-Warning "$Server seems dead not pinging" } } ########## end of script #######################