Update: This code has been integrated and greatly enhanced in the rexchange project by Sam Smoot. Update 2: iCal in Lion supports Exchange and none of this should be required anymore.

Having recently recieved a brand new MacBook Pro from my employer I needed to get basic things such as mail and calendaring working. We use Microsoft Exchange 2003 which is great if everyone is using Outlook. Since I work with various clients I am subjected to their respective firewall policy which typically only allows HTTP(S) traffic. This leaves us with Outlook Web Access (dumbed down interface for everyting but IE). Reading e-mail works fine in OWA. However, the calendar becomes useless as reminders won’t appear.

Unfortunately, Apple’s iCal doesn’t work with Exchange. iCal does, however, store data in the standard icalendar format. Having som experience working with WebDAV access to Exchange (which is available if you can reach OWA) I decided to write an Exchange API in Ruby to read calendar items and convert these to the icalendar format. So, I was about half-way through when I discovered that Sam Smoot had created RExchange. That gave me most of the API:s required for connecting to Exchange.

RExchange did not contain a class for working with appointments (only mail and contacts), so I had to add that. Also, RExchange uses the Time::parse method to convert strings to time representation which doesn’t work for dates after 2037.

Anyway, to export your Exchange calendar to iCal through WebDAV, download the rexport script, unpack the files and modify the rexchange.rb file with your login credentials and OWA URL. Execute rexchange.rb from the terminal. It will create an iCal storage file corestorage.ics in the same directory. This can be opened directly in iCal.

Future options may include a synchronization mode. Suggestions and patches are welcome.