列出Exchange 2003邮箱权限

时间:2009-01-28 22:39:56

标签: c# permissions exchange-server rights

如何列出已分配给域用户邮箱的权限?

e.g。 AD用户的“Exchanged高级”选项卡的“邮箱权限”部分中指定的帐户&计算机?

1 个答案:

答案 0 :(得分:1)

哟,这是非常重要的事情。由于没有.NET包装器(上次我检查过,它回到1.1发呆),你需要与CDOEXM进行COM互操作。

这里有一些伪代码,我希望能让你先知道我的兄弟:

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"
}