Hi all,
I am trying to read information from the GAL using C#. I am able to return a
list of all the addresses and names, however, when I walk through each
address I cannot access the mailbox (I keep getting prompted for
authentication information). Given that the long-term goal here is that the
application run unattended as a service this is obviously not desirable...
My environment consists of the following:
CDO 1.21
Exchange 2003
Outlook 2003
VS .NET 2003
The application (which uses CDO by the way) first of all goes to the
Exchange server and builds up a string array of all the users in the GAL.
Having got these addresses it then attempts to login to each individual
mailbox and extract the email addresses in the Contacts folder individual
mailbox which it writes out to a text file.
If you're thinking that this all sounds a bit nefarious then I wouldn't
blame you but let me assure that it isn't. The generated text file is one of
the criteria that the incoming mail filter uses to decide whether a mail
message should be rejected or left through - simple as that.
I chose CDO for two reasons, one was that I wanted to provide some
independence from different Outlook versions and secondly I wanted to bypass
the annoying dialogs that have become a "feature" of Outlook in recent
versions. However I am experiencing some issues which I am hoping that
someone may be able to help me with...
1. The Outlook security dialog is still coming up! This was one of the
reasons behind not using Outlook day one and instead using CDO. The line
that causes the dialog to come up is:
aeAddressEntry = (MAPI.AddressEntry)aesAdressEntries.get_Item(i);
where:
aeAddressEntry is a MAPI.AddressEntry
aesAdressEntries is a MAPI.AddressEntries collection
i is merely a loop counter
2. I am being prompted for a login for each mailbox, despite the fact that
the ID that the process is running under has Admin privileges - why is this?
I try to type acceptable credentials into it but the dialog keeps coming up
again. WhenI eventually cancel it the error that comes back is
MAPI_E_FAILONEPROVIDER.
3. According to the MSKB (cannot remember the KB#) use of CDO through C# is
not supported - if this is indeed the case what am I better off using?
Any help and pointers welcome - much thanks!
ATB,
Derek
"It's all fun and games till someone loses an eye..."
Derek Noonan, Technical Director, ntech.ie