Tools for Diagnosing Problems with Messaging Software

Tools for DiagnosingProblems with Messaging Software

By danba

Version 1.0

Last Revised 6/30/2006

For testing and debugging code related issues, there are some tools and techniques which can be used to help resolve problems. The following is a list of tools which I use for finding problems with messaging software. Please note that there is no endorsement or preference of any of these programs over others which do the same thing. Also, note that this is not an official Microsoft document.

There are several tools and a lot of information in the Exchange SDK, so it’s a good idea to have it installed. It will provide you with tools and information which are helpful in working with messaging software.

Exchange 2003 SDK Documentation and Samples March 2005

Exchange SDK Development Tools

Please note that when trying to diagnose a problem with messaging software, it’s important to try to be on the “latest and greatest”. So consider applying current service packs and rollups for the OS, Exchange, Outlook, etc. – because your problem may have already been fixed.

Have you gone to lately?

A.Exchange Explorer:

This a very useful tool used for looking at Exchange stores in an interface which looks similar to Windows Explorer. This tool is part of the Exchange SDK . It’s useful for testing things like permissions and can be used to set properties.

Exchange Explorer

You can use this tool to check for items and their properties. This application is built using WebDAV and VB. WebDAV will give you the Web-Store view of items. This tool is useful for diagnosing issues with WebDAV, CDOEX and Exoledb/ADO.

B.MFC MAPI:

This is an awesome tool for looking at and working with items in Exchange. One great use is for finding properties on items. The source code is available – it is written in C and uses Extended MAPI. This is useful for looking at any properties and for viewing the MIME stream of an item.

SAMPLE: MFCMAPI Demonstrates MAPI Client Code

MFC MAPI provides several points of help. First it’s a great utility to get at pretty much any property or to exercise Extended MAPI code to see how it behaves. This applications code was written pretty solid, so if MFC MAPI fails, the problem you’re trying to diagnose may not be with your code. Secondly, you can get ALL of the source code for this application – it’s free to download. This give you a code to compare the code you have an issue with to.

C.Network Monitor (Netmon):

Netmon can be used to sniff the traffic during an http request such as one done via WebDAV call. It’s useful for checking what actually is going on during the WebDAV Call. You will be able to see issues like network errors show-up in it. It’s also useful for seeing the WebDAV calls done by OWA to get an idea on how to write your own WebDAV calls – hey Only a couple of OWA calls are supported - like galfind and freebusy.

About Network Monitor 2.0

Monitoring Network Traffic

Network monitoring tools such as Netmon & NetCAP are helpful for diagnosing network issues and communication problems.

Here are some points to remember:

Netcap is a utility which can also capture network activity – this is optional support tool found on the XP install CD. Logs captured via Netcap can be read by Netmon.

When capturing traffic, its best to capture all traffic for several seconds prior and after a WebDAV call.

When you review the logs, you will see in initial anonymous call. This call should fail and return a list of supported protocols. After this, you should see another call using the designated protocol (Windows, Basic, etc). The second call should work.

When capturing traffic, an initial test should be done from the machine running the code. After the log is reviewed, it may be helpful capture traffic from the Exchange server.

Some things to look for would be: Incorrect protocol being used, errors, excessive traffic, long delays between request and response.

DAdsiedit:

Exchange interacts with ADSI. So, if you wish to see ADSI settings or to compare a Contact with the equivalent in AD, then this a good tool to keep around.

Adsiedit Overview

E.WebDAV Sample Application:

The WebDAV Sample application comes with the Exchange SDK Documentation. It is an HTML file used to do WebDAVcalls and can be used for testing as well as a source of sample code.

FFilemon:

Filemon? That’s not a Microsoft tool! Yes, correct… however it’s a great tool for finding file access related issues. Ever get an access denied and not know where it was? OK, you know that feeling – “where to I start to look?”. Filemon will track all file access and log it for you – all access, searches, denials, etc. This tools can be used to find file related issues for any program I can imagine. One of the most common things it detects is lack of permissions on folders (such as the temp directory or the SMTP pickup directory). Also, programs such as ASP or ASP.NET pages will have code accessing the filesystem and be using an account other than what the developer thought it would be. Sometimes developers also forget that permissions will be different on the box the software is being deployed to – their dev boxes will likely have them as local admin, which will give them higher privileges than what the deployed code will run under.

This utility is found and has OS build specific versions – so please be sure to get the correct one.

When you use Filemon, be sure to have as much shut-down on the machine as possible. This is because it tracks ALL file activity – that can be quite a bit to sift through in a log for a busy system. Like other “mon” utilities, its best to capture traffic a few seconds before and after the troublesome code (which you are trying to fix) executes.

GRegmon:

Regmon… Another non- Microsoft tool! Yes, correct… again, another great tool finding problems – but here its finding registry access issues. . Regmon will track all registry access and log it for you.

This utility is found and has OS build specific versions – so please be sure to get the correct one.

When you use Regmon, be sure to have as much shut-down on the machine as possible. This is because it tracks ALL file activity – that can be quite a bit to sift through in a log for a busy system. Like other “mon” utilities, its best to capture traffic a few seconds before and after the troublesome code (which you are trying to fix) executes.

HOutlookSpy:

Tools like Outlook Spy allow you to see which properties are used by Outlook. If you’re trying to find which property is set by outlook, then this is a nifty tool to have.

ITelNet

Telnet can be used to check for problems writing to port 25. Why is this important? This is because it’s the port used by SMTP servers by default. Messaging APIs which send via SMTPwill send to port 25 by default. Using Telnet will take the code you are using out of the picture – so you can see if it’s a code issue or related to the port/Smtp server.

XFOR: Telnet to Port 25 to Test SMTP Communication

JDependency Walker:

Ever use depends? It’s a great utility for detecting DLL dependencies. It will list the inter-related DLLs, dates, versions, etc. It’s in the Platform SDK and comes with Visual Studio 6 or you can download a copy from:

Depends.exe: Dependency Walker

Sometimes you will run-into situations like missing DLLs, mismatched component versions, etc. You know – the really fun DLL Hell stuff. You can use this to help find where the problem exists. I often use this when a program works on one system but not another.

KComponent Checker:

This checks MDAC components installed. Its great for finding problems with installed MDAC components. CDOSYS, CDOEX and workflows use ADO in MDAC heavily. If ADO has a problem, Messaging APIs may also. This tool can be used to help find issues with ADO.

LVBS:

VBS? Yes, VBS. Its useful for testing API issues. Languages like VB.NET are cool, however sometimes you might run into problems like interop issues. Little ol’ VB Script can be a great way to see if the problem is directly related to the API used. Also, it’s very useful for testing code on servers – where you would not want to put a compiler.

1

Last Revised 6/30/06. Version 1.0