• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 884
  • Last Modified:

Accessing Exchange Mailbox via ADO.NET

Hi everybody,

does anybody has any experience how to connect to an exchange server and read the content of the user mailboxes ? How must the connection string look like ? What is the structure of the exchange server database ? A little code example would be great ;-) .....
0
new_user_xyz
Asked:
new_user_xyz
1 Solution
 
NetPointerCommented:
I think u have to use ComInterOp for CDO or WebDAV....

check the following url for further help

http://www.only4gurus.com/v2/preview.asp?ID=74
http://www.vbug.co.uk/dnz/support/faq/tsviewa.asp?AID=487&QID=479

0
 
vascovCommented:
You can also use the ExOleDB provider.

Support Policy for Microsoft Exchange APIs with .NET Framework Applications
http://support.microsoft.com/?kbid=813349

HTH
0
 
new_user_xyzAuthor Commented:
Hi NetPointer, hi vascov,  
.... but there should be a way to connect to the exchange server via ADO.NET!!! .... does any body has any experience with that ??
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
vascovCommented:
ExOLEDB is an OLEDB provider.

You can use System.Data.OleDb namespace.
0
 
new_user_xyzAuthor Commented:
allright, but how must the connection string look like ?
To get data from the exchange server's database I need to know the tablenames and the rownames etc. .... from where can I get info about the database schema ?
0
 
rovermCommented:
0
 
vascovCommented:
Here's a small sample:

      OleDbConnection conn = new OleDbConnection( @"Provider=Exoledb.DataSource.1;User ID=LOBOMAU\Administrator;
Password=y0uw1$h;Mode=Read;Data Source=file://./backofficestorage/my.exchange.domain.com/MBX/Administrator" );
      OleDbDataAdapter da = new OleDbDataAdapter( "SELECT * FROM Inbox", conn );      
      DataSet ds = new DataSet();
      da.Fill( ds );
      dataGrid1.SetDataBinding( ds, "" );

A tip to find out the shema is to add a connection to the server explorer in VS.NEt. Then it's just point and click...

Also look at this page:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/wss_references_oledb.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_expdk_exoledb_file_url_namespace.asp?frame=true

HTH

0
 
vascovCommented:
BTW, the password in the connection string is just for sample purposes. Don't do that in your production code :)
0
 
vascovCommented:
Did this help ?
0
 
new_user_xyzAuthor Commented:
hi vascov, sorry my answer took so long ;-) ..... at the moment I've to do some other stuff and I will check out how to get access to the exchange mailbox via ADO.NET at the end of the week .... you'll get a message from me at that time ....
0
 
vascovCommented:
hi, have you had the opportunity to try it ?
0
 
new_user_xyzAuthor Commented:
hi, not at all .... but I will try out as soon as possible ;-) ....
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now