我目前正在尝试使用 Exchange PowerShell commandlet 准备一些自动化操作。 我遇到了一些问题。
在 Exchange 服务器上运行 Get-MailboxFolderPermission cmdlet 时,它会返回结果,但结果集中的 'User' 字段看起来像用户的 DisplayName 。 它不是唯一的,我需要返回唯一用户标识符的解决方案(例如 SamAccountName 或 UserPrincipalName)。
继这篇文章之后 - https://serverfault.com/questions/503014/how-to-get-mailbox-folder-permissions-with-samaccountname-or-upn - 我能够使用 User.ADRecipient.UserPrincipalName 属性,但看起来它仅在 Exchange 2013 实例上可用,并且无法在早期 Exchange 版本上使用。
我还发现了一些 PowerShell 函数 ( http://pastebin.com/MQPLJ5pC ),它将 DisplayName 解析为唯一的用户标识符。
看起来可以将它们结合在一起,但我想知道是否有一些更简单的方法来实现它。
我对适用于 Exchange 2007、2010 和 2013 的解决方案感兴趣。
非常感谢任何帮助。
最佳答案
User.ADRecipient.UserPrincipalName 属性也适用于 Exchange 2010。 Exchange 2007 不存在 get-MailboxFolderPermission cmd,因此您需要查看 EWS对于通用的东西。
关于powershell - 从 Get-MailboxFolderPermission cmdlet 返回唯一的用户 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37038451/