how to interface with MS Exchange? 
Author Message
 how to interface with MS Exchange?

We have a system that profiles employees... First name, last name,
department, email etc.  We would like to grab the email of users from
Exchange instead of our current database table.  That way we don't have to
maintain two lists of email addresses.  Right now if someone's email changes
in Exchange it has to be modified also in our db table....  Given a
firstname & lastname, we want to grab the email of the user from exchange
and display it in the datagrid row :)

Thanks for any help, as to what direction to proceed in

Jason Shohet
212-863-6481



Sat, 28 May 2005 21:07:29 GMT  
 how to interface with MS Exchange?
Jason,

Until someone writes a MAPI provider for OLE DB, I think you're stuck using
MAPI directly.  The original MAPI DLL does not even expose a readable
TypeLib (it was written before the COM spec was complete, it appears), so
you're probably best to use the CDO objects, which you can interface with
using .NET/COM interop.  (There's another technology coming:  XSO, or
Exchange Server Objects, but it won't be around until the next rev. of
Exchange server, called Titanium, is around, as far as I know.)

There are a number of varieties of CDO, but the one you probably want is CDO
1.21, which you will find in the "COM" components tab of the Add Reference
dialog.  You'll need to create a session to talk to the Exchange server,
using a profile (look for the Session object), and you should be able to
figure it out from there.  Be a bit careful about how you marshal strings
back and forth from CDO;  there are a number of good articles on COM interop
which will help you figure out how (just do a search for "COM Interop" and
"string marshalling").

I've written full MAPI-interop libraries in C# a couple of times now, so
drop me an email (remove the nospams from my address) if you'd like to delve
into further depth.

Regards,
/s/ James



Quote:
> We have a system that profiles employees... First name, last name,
> department, email etc.  We would like to grab the email of users from
> Exchange instead of our current database table.  That way we don't have to
> maintain two lists of email addresses.  Right now if someone's email
changes
> in Exchange it has to be modified also in our db table....  Given a
> firstname & lastname, we want to grab the email of the user from exchange
> and display it in the datagrid row :)

> Thanks for any help, as to what direction to proceed in

> Jason Shohet
> 212-863-6481



Sun, 29 May 2005 09:14:34 GMT  
 how to interface with MS Exchange?
Thanks James.
I'm going to try to convince my boss that its better to wait for Titanium's
.NET enabled XSO's.  I wonder if they'll be as simple as coding this in a
.NET app:

strEmail = myXSO.get_email(Clinton, William);    // go to Exchange and get
this dude's email

I was even thinking, Exchange already has firstname, lastname, address,
phone, email,   etc....
The ldap database for Exchange could theoretically be used as a single
resource for identifying users in our company.  Perhaps we would require a
separate table in our main database for other attributes that Exchange
doesn't cover... but its better than maintaining emails and phone numbers
now in 2 different places which is what we have now <g>.

thanks
jason Shohet



Sun, 29 May 2005 20:39:27 GMT  
 how to interface with MS Exchange?


Quote:
> I was even thinking, Exchange already has firstname, lastname, address,
> phone, email,   etc....
> The ldap database for Exchange could theoretically be used as a single
> resource for identifying users in our company.  Perhaps we would require a
> separate table in our main database for other attributes that Exchange
> doesn't cover... but its better than maintaining emails and phone numbers
> now in 2 different places which is what we have now <g>.

You can always extend the Active Directory schema, if you need custom
attributes...

Massimo



Sun, 29 May 2005 20:55:52 GMT  
 how to interface with MS Exchange?

Quote:
> You can always extend the Active Directory schema, if you need custom
> attributes...

wow... i just talked to our network engineer & he says the Exchange emails
are really coming from AD.  So I should be asking how to query info from AD
:)
ie, lets say I'm developing a datagrid that shows name, department, email &
phone # for users that match some search criteria.  And I don't want this
user info to be in a separate db [as we have now] I want to query AD.  I
wonder if this is relatively easy <g>


Sun, 29 May 2005 22:12:08 GMT  
 how to interface with MS Exchange?


Quote:
> > You can always extend the Active Directory schema, if you need custom
> > attributes...

> wow... i just talked to our network engineer & he says the Exchange emails
> are really coming from AD.  So I should be asking how to query info from
AD
> :)
> ie, lets say I'm developing a datagrid that shows name, department, email
&
> phone # for users that match some search criteria.  And I don't want this
> user info to be in a separate db [as we have now] I want to query AD.  I
> wonder if this is relatively easy <g>

Yes, it is :-)
You should look into the ADSI (Active Directory Services Interface)
libraries supplied by Microsoft; and, yes, there's an ADSI implementation
coming with the .NET framework :-)

Massimo



Mon, 30 May 2005 04:28:10 GMT  
 how to interface with MS Exchange?
You should be able to do this fairly simply using COM interop to talk to
CDO.

There's a very simple example here:

http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=cdo

though you'd need to interface with the address book instead.

--
Visit the C# product team at http://www.gotdotnet.com/team/csharp

This posting is provided "AS IS" with no warranties, and confers no rights.



Quote:
> We have a system that profiles employees... First name, last name,
> department, email etc.  We would like to grab the email of users from
> Exchange instead of our current database table.  That way we don't have to
> maintain two lists of email addresses.  Right now if someone's email
changes
> in Exchange it has to be modified also in our db table....  Given a
> firstname & lastname, we want to grab the email of the user from exchange
> and display it in the datagrid row :)

> Thanks for any help, as to what direction to proceed in

> Jason Shohet
> 212-863-6481



Mon, 30 May 2005 11:55:52 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Ms Exchange in C#

2. UNIX, C, Networking, Admin, COBOL, MS Exchange

3. Access to MS-Exchange data from VC++

4. Telex MS Exchange/Notes Integration

5. Programming MS Money/ MSN Explorer-like user interface

6. C++ or C interface with MS Access

7. The MS Source Code Control Interface

8. Interface to GWBASIC in MS-DOS

9. Interfacing with MS Access Databases

10. COM Interface to MS Project

11. MS Jet 4.0 Interface

12. MS Access Automation interface

 

 
Powered by phpBB® Forum Software