Solved

VB Or Power Shell Test Exchange Email Functionality

Posted on 2014-04-03
6
402 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
how to add IIS SMTP to handle application/Scanner relays into office 365.

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now