Exchange 邮箱目录条目属性列表

本文关键字:属性 列表 Exchange | 更新日期: 2023-09-27 18:31:29

你能告诉我它是否存在交换邮箱对象的目录条目属性列表吗?

这是我的代码示例:

// create your domain context
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, ConfigurationManager.AppSettings["ADDomain"].ToString(), ConfigurationManager.AppSettings["ADUser"].ToString(), ConfigurationManager.AppSettings["ADPassword"].ToString());
// define a "query-by-example" principal - here, we search for all users
UserPrincipalEXT qbeUser = new UserPrincipalEXT(ctx);
// create your principal searcher passing in the QBE principal    
PrincipalSearcher srch = new PrincipalSearcher(qbeUser);
// find all matches
foreach (var found in srch.FindAll())
{  
    if (found.GetUnderlyingObjectType() == typeof(DirectoryEntry))
    {
        DirectoryEntry de = (DirectoryEntry)found.GetUnderlyingObject();
    }                 
}

我正在努力寻找我需要的属性的名称......

谢谢!

Exchange 邮箱目录条目属性列表

DirectoryEntry.Properties的类型为 PropertyCollection。这将公开可用于枚举属性的属性,如属性名称。

foreach (var name in de.Properties.PropertyNames)
{
    Console.WriteLine(name);
}