如何列出已分配给域用户邮箱的权限?
e.g。 AD用户的“Exchanged高级”选项卡的“邮箱权限”部分中指定的帐户&计算机?
答案 0 :(得分:1)
这里有一些伪代码,我希望能让你先知道我的兄弟:
DirectoryEntry userDirectoryEntry; // you need to new this up
IExchangeMailbox exchangeMailbox = (IExchangeMailbox)userDirectoryEntry.NativeObject;
IADsSecurityDescriptor securityDescriptor = (IADsSecurityDescriptor) exchangeMailbox.MailboxRights;
IADsAccessControlList acl = (IADsAccessControlList) securityDescriptor.DiscretionaryAcl;
// Iterate thru each ACE in the ACL
foreach ( IADsAccessControlEntry ace in acl)
{
// in here, you'll have access to each "ace"
}