如何从 Exchange 获取 "What other user's calendars can a user edit"

How to get "What other user's calendars can a user edit" from Exchange

我正在尝试在服务器端 C# 应用程序中查找给定用户对哪些其他用户的日历具有编辑权限。

在我编写的 Web 应用程序中,当一个用户拥有另一个用户的 "Calendar Edit" 权限时,我们的客户希望他们能够在我们的应用程序中修改其他用户的配置。因此,当用户登录到我们的 Web 应用程序时,我们需要能够了解这些用户是谁,以便将他们显示给目标用户。

我研究了能够让我 "A list of users with editor rights to this mailbox's calendar" 的 EWS 和 PowerShell cmdlet,但是 none 处理 "A list of calendars this user can edit"。这让我觉得这将是一个与确定文件系统权限类似的问题(即,这是一个询问 "Give me the users who can access this specific filesystem folder" 的调用,但是 enumerating/evaluating all 的操作文件系统中的 ACL 以回答 "give me all of the folders this user has access to").

虽然我可以采用 "get permissions for every mailbox's default calendar" 的路线并将其映射到我们应用程序中的用户,但在授予权限和应用程序了解这些权限之间会存在延迟。

为此,我一直在研究 EWS 和 PowerShell,但我不受这些 API 的限制。该应用程序在 Windows Server 2012+ 上运行,并且可以分配获取此信息所需的任何权限(它不是 运行 作为用户 ,而是服务帐户)。但我愿意 任何 API/method 可以获取此信息,前提是它比大型邮箱 ACL 枚举操作更快。

所以我想知道,是否有 PowerShell 命令或 EWS 方法可以为用户检索用户有权访问的 Exchange 环境中所有邮箱中的所有文件夹?

编辑: 看来答案如我所料:不,没有。唯一的选择是枚举邮箱以获得权限。

It's making me think it will be a similar problem to determining filesystem rights (i.e., it's one call to ask "Give me the users who can access this specific filesystem folder", but an operation of enumerating/evaluating all of the ACLs in the filesystem to answer "give me all of the folders this user has access to").

这是完全相同的问题,没有 ACL 的反向链接,因此您了解用户是否已被授予对另一个用户邮箱中特定文件夹的访问权限的唯一方法是枚举所有目标邮箱(如果权限具有已通过 Outlook Delegates 授予,那就是另一回事了,因为有 delegates 的反向链接)。通常,最简单的方法是对日历文件夹使用 Get-MailboxFolderPermission https://technet.microsoft.com/en-us/library/dd335061(v=exchg.160).aspx。该 cmdlet 将 运行 具有委派的 RBAC 权限(使其更安全),而不需要任何邮箱 API 或 EWS 模拟所需的显式权限。