Forwarding to Another Mailbox Programmatically

If you usually try searching the MSDN offline then online and finally use the Google like I do when searching for a particular property in the Active Directory Schema, you may get into a situation where you are unable to find what you are looking for. Usually you get into this situation when you search using the displayed name in the graphical interface.

I was in the meddle of a big cross-forest “Exchange Server 2003” migration project where the “Migration Wizard” tool has failed me and gave me really hard time. While it was so success in the lab and testing, when we run it in production it kept working over 14 hours and finished less than %60 of the job. Where the tests assumed it will finish by less than 6 hours.

However, to work around the issue I had to develop a code to keep both Exchange organizations sync’d. And to make the operation semi-automated (specially with 2100+ mailboxes) I was looking for the attribute that allows me to set the forwarding information for the user object in AD. And as you expect, found nothing on the Internet nor in the MSDN library (maybe because I’m not a programmer- I’m just another MCSE J). So searching for “Forward to:” or “deliver messages to both forwarding address and mailbox” or “Forwarding Address” got me nothing. The alternate was by using a dummy user account, create a mailbox for it, and set that attribute to forward to my mailbox. Then using the ADSIEDIT tool (from the Support Tools on Windows CD) to find the “Forward to:” value in the user object. And found it under “altRecipient”. Then I assumed the “deliver messages to both forwarding address and mailbox” value would be a Boolean, and I was right. It was under ‘deliverAndRedirect”.

Oh yeah, need lot of work to find the attribute, but setting the value and search for it one by one is not really the best way, is it? So, doing some more search guided me to the right location (at least for Exchange), at http://msdn2.microsoft.com/en-us/library/ms873635.aspx

Enjoy it :)

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *

هذا الموقع يستخدم Akismet للحدّ من التعليقات المزعجة والغير مرغوبة. تعرّف على كيفية معالجة بيانات تعليقك.