locked
Script to send a email when exchange server is out ot netwrok or Down RRS feed

  • Question

  • Hi Team

    I am really looking for the script for my exchnage servers , when it the exchange server is down ot if it its request timed out while pinging

    The scrpt should be run for each and every 10 Min which is will run the PING command against the Exchange server , if the exchange server got rebooted or shutdown unxpectedly, it should send the email.

    How do i access this....

    Exchange server 2007 running on both Server 2003 and Server 2008

     

     


    ramakrishnan
    Monday, October 3, 2011 2:28 PM

Answers

  • Hi,

    Usually we use 3rd Party tools to monitor the health and performance of  Exchange server.

    Some good tools such as MOM 2005 is very good for exchange server.

    http://www.msexchange.org/articles_tutorials/exchange-server-2007/monitoring-operations/monitoring-exchange-server-2007-mom-2005-part1.html

    I have no idea that how to use powershell script to ping the server. I would suggest you post the question to Technet script forum:

    http://social.technet.microsoft.com/Forums/en/ITCG/threads/


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Jackzhou_5 Tuesday, October 11, 2011 3:33 AM
    • Marked as answer by Jason LJS Tuesday, October 11, 2011 5:41 AM
    Wednesday, October 5, 2011 1:44 AM
  • If you want to use Ping, you have two options:

     

    1. Using the Test-Connection method:

    $reply = Test-Connection -Computername "server" -Count 2 -Delay 1
    
    ForEach ($answer in $reply)
    {
    	If ($answer.StatusCode -ne 0)
    	{
    		# Do something
    	}
    }
    


    2. Using the .NET method:

    $ping = new-object System.Net.NetworkInformation.Ping
    $reply = $ping.Send("server")
    $reply.status
    
    If ($reply -ne "Success")
    {
    	# Do something
    }
    

    All you have to do is complete the script with what you want to do in case the Ping fails, extend it to include all the servers you want to test and schedule it to run every 10 minutes!   :)

    Hope this helps!


    http://LetsExchange.blogspot.com
    • Proposed as answer by Jackzhou_5 Tuesday, October 11, 2011 3:34 AM
    • Marked as answer by Jason LJS Tuesday, October 11, 2011 5:41 AM
    Wednesday, October 5, 2011 10:00 AM

All replies

  • Hi,

    Usually we use 3rd Party tools to monitor the health and performance of  Exchange server.

    Some good tools such as MOM 2005 is very good for exchange server.

    http://www.msexchange.org/articles_tutorials/exchange-server-2007/monitoring-operations/monitoring-exchange-server-2007-mom-2005-part1.html

    I have no idea that how to use powershell script to ping the server. I would suggest you post the question to Technet script forum:

    http://social.technet.microsoft.com/Forums/en/ITCG/threads/


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Jackzhou_5 Tuesday, October 11, 2011 3:33 AM
    • Marked as answer by Jason LJS Tuesday, October 11, 2011 5:41 AM
    Wednesday, October 5, 2011 1:44 AM
  • Thanks jason

     

    i have poted in the link

     

    http://social.technet.microsoft.com/Forums/en/ITCG/threads/

     

    Let see

     

     


    ramakrishnan
    Wednesday, October 5, 2011 7:51 AM
  • If you want to use Ping, you have two options:

     

    1. Using the Test-Connection method:

    $reply = Test-Connection -Computername "server" -Count 2 -Delay 1
    
    ForEach ($answer in $reply)
    {
    	If ($answer.StatusCode -ne 0)
    	{
    		# Do something
    	}
    }
    


    2. Using the .NET method:

    $ping = new-object System.Net.NetworkInformation.Ping
    $reply = $ping.Send("server")
    $reply.status
    
    If ($reply -ne "Success")
    {
    	# Do something
    }
    

    All you have to do is complete the script with what you want to do in case the Ping fails, extend it to include all the servers you want to test and schedule it to run every 10 minutes!   :)

    Hope this helps!


    http://LetsExchange.blogspot.com
    • Proposed as answer by Jackzhou_5 Tuesday, October 11, 2011 3:34 AM
    • Marked as answer by Jason LJS Tuesday, October 11, 2011 5:41 AM
    Wednesday, October 5, 2011 10:00 AM
  • Thanks nuno, will check and let you also there are some other scripts recommed by other...

     

    let us see


    ramakrishnan
    Thursday, October 6, 2011 3:43 AM