h1

Making it harder than necessary

January 19th, 2006

On an Exchange server where I have an account, there is a public folder that receives alert messages. I want to collect all the messages in this folder, filter by subject, order by date, and extract text values out of the body of each message. I’d like the output to be delimited text so I can use other tools to perform further analysis, such as loading it into Excel and building a pivot table, or sorting and slicing with any number of tools. I’d like to be able to repeat this automatically.

I started by looking for script examples.

The first ones I found used VBScript under WSH to instantiate the CDO MAPI.Session object, create a Public Folders collection and iterate from there. There are a few different reasons I don’t want to use this approach:

  • The machine it runs on needs to have the proper CDO objects on it (pretty well has to be an Exchange server according to the product grid in technote Q171440). I want to run this from any computer that can connect to the server.
  • There needs to be a login on that machine with a configured Outlook profile.
  • I have an inexplicable aversion to using WSH/VBScript for scripts that may ever run unattended.

The next solution I found used ADODB to query Exchange via the Exoledb datasource.

  • again, this object seems only to be on an Exchange server. You have to run it from the same server.

I thought I’d try loading up Outlook on my PC to have a look. It’s installed but I never use it (I use Outlook Express against my main POP3 and OWA against this server). I start up Outlook and go to Tools..Accounts, and select Exchange Server from the wizard.

  • It tells me I have to close Outlook and use the Control Panel’s Mail app to add an exchange account to my profile.

After setting it up, I get into Outlook and navigate to the folder. I choose File..Export and try to export to Excel, to Text, to ANYTHING.

  • Sorry, that feature not installed. I haven’t got my Office install media with me, so no go.

I have a colleague try from his Outlook and it’s useless because no matter how hard we tried:

  • the export process could not include the received datetime field. Not even in the list of mappable fields.

Next, I decided to connect to the server with NNTP or IMAP or POP3.

  • These services are all turned off.

Next, I tried to connect to the server’s M: drive which should be an ExIFS filesystem view of the Exchange store.

  • It’s not shared out or I don’t have access to that share.

I tried to RDP into the server.

  • I don’t have login permissions on the server.

Ok, so ask me what I think of closed systems and protocols. Against any IMAP or NNTP server, I would have been done in 5 minutes with no dependencies.

Comments are closed.