Search code examples
apioutlookexchange-server

Outlook API mail enabled vs mailbox user


A very nuanced question and maybe environment specific. I am trying to use Outlook 2010 API to discern mailbox users from mail-enabled users. We are using Dell Quest migration tooling during a Notes to Exchange migration and it is a fluid project. Still in the prototype stage, so using VB Macros for what will eventually be delivered in C#.

Last week, I was using the check “myRecipient.AddressEntry.AddressEntryUserType <> olExchangeUserAddressEntry”, where myRecipient was part of the myItem.Recpients list, where myItem was retrieved from the ActiveInspector.CurrentItem of an email item. Presumably, the Coexistence guys made some change to Active Directory replication and now everyone is showing up as an Exchange user, even non-migrated to Exchange users. Microsoft documentation seems to say olExchangeUserAddressEntry means "user is in GAL".

In Outlook 2010 GAL UI (when picking recipients after clicking the To button), I see visual indicators about mail-enabled vs. mailbox users. The mail-enabled users have a globe in the icon. The mailbox users don't. Any idea what property I need to access to distinguish mailbox users from mail enabled users in a migrating environment?

I'd like to keep inside the Outlook API, but want to know how that's possible for this query, or whether addition of the AD API is required.

Thanks, Jason


Solution

  • Use the PR_DISPLAY_TYPE (DASL name http://schemas.microsoft.com/mapi/proptag/0x39000003) property. Mailbox enabled users are DT_MAILUSER (0) vs DT_REMOTE_MAILUSER (6). The property can be accessed using AddressEntry.PropertyAccessor.GetProperty.

    Take a look at the GAL objects using OutlookSpy (I am its author - click IAddrBook, OpenRootContainer | GetHierarchyTable, etc.)