您能告诉我它是否存在exchange对象的DirectoryEntry属性列表吗?
下面是我的代码示例:
// 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();
}
}我很难找到我需要的房产的名字.
谢谢!
发布于 2014-11-21 15:58:00
DirectoryEntry.Properties是PropertyCollection型的。这公开了可以用于枚举属性的属性(如PropertyNames )。
foreach (var name in de.Properties.PropertyNames)
{
Console.WriteLine(name);
}https://stackoverflow.com/questions/27065239
复制相似问题