【问题标题】:How give trust to an external application accessing the Outlook Object Model (with all security options on)如何信任访问 Outlook 对象模型的外部应用程序(打开所有安全选项)
【发布时间】:2020-09-09 06:26:14
【问题描述】:

我有一个与 Outlook 交互的 .NET 应用程序,如下所示:

                Microsoft.Office.Interop.Outlook.Application app = new
              Microsoft.Office.Interop.Outlook.Application();
                Microsoft.Office.Interop.Outlook.MailItem item = app.CreateItem((Microsoft.Office.Interop.Outlook.OlItemType.olMailItem));
                item.PropertyAccessor.SetProperty(PsInternetHeaders + Foobar, 1031);
                item.BodyFormat = Microsoft.Office.Interop.Outlook.OlBodyFormat.olFormatHTML;
                item.To = "a@test.com;b@test.com;c@test.com";
                item.BCC = "cc@test.com";
                item.Body = "Hello There!";
                item.Display();

请注意,我需要访问“PropertyAccessor”属性。

在正常环境中,它运行良好,但在具有此注册表项的“安全”环境中,它只是以Operation aborted (Exception from HRESULT: 0x80004004 (E_ABORT)) 失败:

[HKEY_CURRENT_USER\Software\Policies\Microsoft\office\16.0\outlook\security]
"PromptOOMAddressBookAccess"=dword:00000000
"AdminSecurityMode"=dword:00000003
"PromptOOMAddressInformationAccess"=dword:00000000

Outlooks 安全模型似乎有一个“受信任的插件”列表,但我不确定这是否也适用于“外部应用程序”以及我是否需要在TrustedAddins 下注册(请参阅here)。 我的主要问题是:我可以在trustedaddins 下注册和 foobar.exe 还是根本不可能? 我知道我可以降低或禁用安全性,但这不是我的选择;)

【问题讨论】:

    标签: outlook com outlook-object-model


    【解决方案1】:

    How to avoid Outlook Security Alert when sending Outlook message from VBScript? 列出了您唯一的选择

    您可能还想将 PsInternetHeaders 属性设置为仅字符串,而不是整数。

    【讨论】:

    • 只是为了确保我正确理解这一点:如果应用了“程序访问策略”(+ GPO 设置),则跨进程方式(除了 MAPI 或 ClickYes 的东西)关闭,对吗? (来源:docs.microsoft.com/en-us/office/vba/outlook/how-to/security/…)
    • 如果用户使用 Exchange,则由 Exchange 策略决定。如果您不想以编程方式解决问题(C++/Delphi 中的扩展 MAPI 或任何语言的 Redemption),安装最新的 AV 应用程序可能是最简单的方法。
    • 问题只出现在“AdminSecurityMode=3”,我们无法更改:-/ 感谢您的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多