Solved

VB Or Power Shell Test Exchange Email Functionality

Posted on 2014-04-03
6
401 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

763 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

11 Experts available now in Live!

Get 1:1 Help Now