Ping Multiple Server Using PowerShell and Email the Output - v2

Hi, In Jan i upload the scipt to ping multiple servers using powershell {}.yesterday i got an request from user, he want to email the Output of the script. to full fill his requirement I twaeked the s

5 Star
3,661 times
Add to favorites
E-mail Twitter Digg Facebook
  • How to
    1 Posts | Last post April 16, 2019
    • Hi Aman,
      Thanks for your script. While running a script. Error occurring. Need your support.
      PS D:\Cloud alert\002> .\Ping_Multiple_Server_With_Email.ps1
      .\Ping_Multiple_Server_With_Email.ps1 : File D:\Cloud alert\002\Ping_Multiple_Server_With_Email.ps1 cannot be loaded
      because running scripts is disabled on this system. For more information, see about_Execution_Policies at
      At line:1 char:1
      + .\Ping_Multiple_Server_With_Email.ps1
      + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : SecurityError: (:) [], PSSecurityException
          + FullyQualifiedErrorId : UnauthorizedAccess
  • Felicitaciones
    1 Posts | Last post February 14, 2018
    • Excelente aporte, muchas gracias!!
  • Hi Aman
    1 Posts | Last post June 05, 2017
    • thanks for sharing your expertise with us i am an IT admin but i haven´t had experience with PS.
      thanks for this script i´ve configure and scheduling an alert if one of my  100 servers get down i ´ve modified your script for only send me an alert when servers goes down. i just print the else when server is inactive  putting an $ on body to only send me an email when the value of $body  is actived
      every 10 minutes is running this task and it Works! i wanted appreciate your knowledge  and greatly appreciated!
      					if (test-Connection -ComputerName $Server -Count 3 -Quiet ) { 
      						body += write-output "$Server   esta ACTIVO ----| `n" 
      							} else { $body += Write-output "$Server esta INACTIVO!!!! `n" 
      send-MailMessage -SmtpServer $smtp -To $to -Subject $sub -Body $body  -From $from  
  • Extract in a notepad
    2 Posts | Last post December 08, 2015
    • Hi Aman,
      First of all I want to thank you for doing this great job.
      I have a query. Is there any way to extract the ping result in the notepad in the local machine from where I am going to run the script.
    • HI Quaseem, 
      Thanks for your kind words, Just try to redirect the output to a text file using, Out-File :) 
  • How to run this script 24/7
    2 Posts | Last post December 08, 2015
    • Hi Aman,
      I need to run this 24/7. If am configured on scheduled jobs, whether it will work . So i can get the mail when any of the server goes down from network? Please suggest
    • Hello Mathivathani,
      Yes you can schedule it :) , try to schedule it to run it every 10 minutes or so :) 
  • Is there an option to test ports
    1 Posts | Last post September 13, 2015
    • Hi this is a great script and thank you.... but I would love to extend this to add the option of testing 1 (or even better many) ports. So if we can use the Test-NetConnect, lets say with -port 443,1723,80,22,21 ..... so we can test each service on a host and then email the failed server/port...? 
      Are you up for the challenge ;-)