【问题标题】:Outlook API mail enabled vs mailbox user启用 Outlook API 邮件与邮箱用户
【发布时间】:2016-05-02 14:22:56
【问题描述】:

一个非常微妙的问题,也许是特定于环境的。我正在尝试使用 Outlook 2010 API 来区分邮箱用户和启用邮件的用户。我们在 Notes 到 Exchange 迁移期间使用 Dell Quest 迁移工具,这是一个流畅的项目。仍处于原型阶段,因此使用 VB 宏来实现最终将在 C# 中交付的内容。

上周,我使用检查“myRecipient.AddressEntry.AddressEntryUserType olExchangeUserAddressEntry”,其中 myRecipient 是 myItem.Recpients 列表的一部分,其中 myItem 是从电子邮件项目的 ActiveInspector.CurrentItem 中检索的。据推测,Coexistence 人员对 Active Directory 复制进行了一些更改,现在每个人都显示为 Exchange 用户,甚至未迁移到 Exchange 用户。 Microsoft 文档似乎说 olExchangeUserAddressEntry 的意思是“用户在 GAL 中”。

在 Outlook 2010 GAL UI 中(在单击“收件人”按钮后选择收件人时),我看到了有关启用邮件与邮箱用户的视觉指示器。启用邮件的用户的图标中有一个地球仪。邮箱用户没有。知道在迁移环境中我需要访问什么属性来区分邮箱用户和启用邮件的用户吗?

我想保留在 Outlook API 中,但想知道此查询如何实现,或者是否需要添加 AD API。

谢谢, 杰森

【问题讨论】:

    标签: api outlook exchange-server


    【解决方案1】:

    使用PR_DISPLAY_TYPE(DASL 名称http://schemas.microsoft.com/mapi/proptag/0x39000003)属性。启用邮箱的用户是 DT_MAILUSER (0) 与 DT_REMOTE_MAILUSER (6)。可以使用 AddressEntry.PropertyAccessor.GetProperty 访问该属性。

    使用OutlookSpy 查看 GAL 对象(单击 IAddrBook、OpenRootComtainer | GetHierarchyTable 等)

    【讨论】:

      【解决方案2】:

      希望我遵循协议,但很难将 cmets 添加到以前的帖子中。德米特里的建议一针见血。

      当前代码:

      For Each myRecipient In myItem.Recipients
           'Simple "Exchange User" interrogation worked last Thursday
                  Dim test1 As Boolean
                  test1 = myRecipient.AddressEntry.AddressEntryUserType <> olExchangeUserAddressEntry
      
                  Dim test2 As Boolean
                  Dim myAccessor As PropertyAccessor
                  Set myAccessor = myRecipient.PropertyAccessor
                  If Not test1 Then
                      myDisplayType = myAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x39000003")
                      test2 = myDisplayType <> 0 'Not an Exchange user
                  Else
                      test2 = False
                  End If
      

      试图找到更好的常量来测试 myDisplayType,但现在已经足够了。谢谢,德米特里。您表现出了出色的专业知识。

      问候, 杰森

      【讨论】:

        猜你喜欢
        • 2014-04-04
        • 1970-01-01
        • 2018-04-23
        • 2011-06-03
        • 2020-05-30
        • 2012-01-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多