Solved

VB Or Power Shell Test Exchange Email Functionality

Posted on 2014-04-03
6
404 Views
Last Modified: 2014-04-11
Does anyone have a script to run as a job every so often to text if exchange is sending email out its queue?  We have a client with a large exchange environment and once in a while it stops working, our own internal exchange server could alert us, I know VB can send email directly to any server we choose, we have VPN tunnel connectivity to the other environment...

I tried to word it the best I could but would love some input and or questions.

Thanks!
0
Comment
Question by:smyers051972
  • 2
  • 2
6 Comments
 
LVL 38

Expert Comment

by:Rich Rumble
ID: 39978054
You can use VBScript, it requires that a user be logged in, and it will run as that user using outlook. http://support.microsoft.com/kb/161088
This one does not require outlook, and can use a 3rd party like gmail to send the email perhaps as another kind of test (receiving test).
http://cmanios.wordpress.com/2012/09/12/send-email-from-vbscript-using-smtp-and-gmail/
-rich
0
 
LVL 1

Author Comment

by:smyers051972
ID: 39978330
I had some time to think on this so here is our situation we have multiple domains, our own internal one we can call domainx.com and the clients exchange domainy.com we could use a script on our end to send us an email from the clients domain to us.... I am not sure what else from there.  I would prefer not using outlook if possible.
0
 
LVL 1

Author Comment

by:smyers051972
ID: 39978344
If not that way I am thinking need a way to test if Exchange SMTP is working, if its not email us a ticket to our support email...
0
 
LVL 38

Accepted Solution

by:
Rich Rumble earned 500 total points
ID: 39978435
Is there possibly an event in the evt log that gets triggered when it dies? Does the exe/service itself stop? If the service stops or the exe does, you can create a trigger using vbscript to send an alert with a 3rd party email like google or some other SMTP server that is working. Well the script can do a lot of things really, and services have a extra method within themselves to try to restart themselves if they fail. The "recovery" tab has all sorts of actions you can take: http://technet.microsoft.com/en-us/library/cc753662.aspx
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process Where Name = 'exchange.exe'")
If colProcesses.Count = 0 Then
    Wscript.Echo " Exchange.exe is not running."
Else
    Wscript.Echo " Exchange.exe is running."
End If

Open in new window

If you want to search for a specific Event code or item:
http://blogs.technet.com/b/heyscriptingguy/archive/2007/02/26/how-can-i-monitor-event-log-messages-for-specific-words.aspx
http://blogs.technet.com/b/heyscriptingguy/archive/2005/08/16/how-can-i-monitor-the-event-logs-for-the-occurrence-of-a-specific-event.aspx (how to loop)
-rich
0
 
LVL 42

Expert Comment

by:kevinhsieh
ID: 39978456
I use a program called IPsentry to monitor my Exchange environment. Specifically it has the ability to send an email via SMTP and then check to via POP3 if it has been delivered. It can send out email and text alerts, and it has a ton of other functionality, and its very reasonably priced. If you want to check outgoing queues, you could relay a message from their server and then check for it on your server or any other mail provider that accepts POP3 access. You can also check the event logs, though I have no idea what to look for.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In-place Upgrading Dirsync to Azure AD Connect
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question