简体   繁体   English

Exchange邮箱DirectoryEntry属性列表

[英]Exchange mailbox DirectoryEntry properties list

Can you tell me if it exist a list of the DirectoryEntry properties for an exchange Mailbox object ? 您能告诉我是否存在Exchange邮箱对象的DirectoryEntry属性列表?

Here's the sample of my code : 这是我的代码示例:

// 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();
    }                 
}

I am struggling to find the name of the properties I need... 我正在努力寻找所需属性的名称...

Thank you ! 谢谢 !

DirectoryEntry.Properties is of type PropertyCollection . DirectoryEntry.Properties的类型为PropertyCollection This exposes properties like PropertyNames that you can use to enumerate properties. 这将显示诸如PropertyNames之类的可用于枚举属性的属性。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM