# Reading data from MS Exchange

**URL:** <https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547>\
**Category:** Ruby\
**Created:** [April 8, 2010, 5:34pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547 "2010-04-08T17:34:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 8, 2010, 5:34pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/1 "2010-04-08T17:34:29Z")

</div>

Hi, is there a possibility to read MS Exchange data from an ROR/Ruby  
application ?, if yes, can it then also be written to an sql db ?.  
Thanks in advance,

Dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 8, 2010, 6:11pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/2 "2010-04-08T18:11:28Z")

</div>

On Thu, Apr 8, 2010 at 11:34 AM, Dani D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi, is there a possibility to read MS Exchange data from an ROR/Ruby  
> application ?

I think there was a question on the list not long ago about Ruby and  
Microsoft Exchange; I don’t remember anything really coming from it,  
but it might be worth checking the list archives.

What data are you trying to read and what version of Exchange?

> if yes, can it then also be written to an sql db ?

If you have data in Ruby, then yes it is definitely possible to write  
it to a sql database.

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 8, 2010, 10:33pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/3 "2010-04-08T22:33:45Z")

</div>

On Thu, Apr 8, 2010 at 4:09 PM, Matt M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I don’t know Exchange so couldn’t say for sure, but if everything in Exchange is stored in Active Directory (and that would be my guess)… you can use the ActiveLdap library to get whatever you want from AD.

The address book and some stuff like configuration metadata is stored  
in the directory; but, messages, calendar items, and such (most of the  
real stuff) are stored in Exchange’s own database.

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 8, 2010, 10:10pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/4 "2010-04-08T22:10:20Z")

</div>

I don’t know Exchange so couldn’t say for sure, but if everything in  
Exchange is stored in Active Directory (and that would be my guess)…  
you can use the ActiveLdap library to get whatever you want from AD.

Matt

----- Original Message -----  
From: “Dani D.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: “ruby-talk ML” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, April 8, 2010 10:34:31 AM  
Subject: Reading data from MS Exchange

Hi, is there a possibility to read MS Exchange data from an ROR/Ruby  
application ?, if yes, can it then also be written to an sql db ?.  
Thanks in advance,

Dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 8, 2010, 10:37pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/5 "2010-04-08T22:37:51Z")

</div>

On Fri, 9 Apr 2010, Dani D. wrote:

> Hi, is there a possibility to read MS Exchange data from an ROR/Ruby  
> application ?, if yes, can it then also be written to an sql db ?.  
> Thanks in advance,

Is it data acessible via IMAP? And yes, Ruby/RoR can write to sql  
databases…

Matt

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 9, 2010, 11:28am UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/6 "2010-04-09T11:28:42Z")

</div>

Thank you to all,  
What I’m looking for is to get the contacts from the exchange db.  
Dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 9, 2010, 11:53am UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/7 "2010-04-09T11:53:21Z")

</div>

Hi Dani,

I did the same thing some time ago. the contact information is hidden  
and depending on the software version only available via the web  
interface. you can access that via WSDL.

bernd

Am 09.04.2010 11:28, schrieb Dani D.:

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [April 9, 2010, 7:18pm UTC](https://www.ruby-forum.com/t/reading-data-from-ms-exchange/186547/8 "2010-04-09T19:18:10Z")

</div>

On Fri, Apr 9, 2010 at 5:28 AM, Dani D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thank you to all,  
> What I’m looking for is to get the contacts from the exchange db.

Then you should be able to get what you need via LDAP (and Ruby does  
have ldap client libraries). For literal Exchange Contact objects,  
try a query like:  
(objectClass=contact)

For user objects with email addresses, try something like:  
(objectClass=user)(email=\*)
