0
我试图从Active Directory获取主目录的属性值“主目录”属性..从Active Directory获取
我用下面的代码:
public static void GetExchangeServerByWwidLdap(string wwid)
{
var exchange = string.Empty;
using (var ds = new DirectorySearcher())
{
ds.SearchRoot = new DirectoryEntry("GC:something");
ds.SearchScope = SearchScope.Subtree;
//construct search filter
string filter = "(&(objectclass=user)(objectcategory=person)";
filter += "(employeeid=" + wwid + "))";
ds.Filter = filter;
string[] requiredProperties = new string[] { "homeDirectory", "homemta" };
foreach (String property in requiredProperties)
ds.PropertiesToLoad.Add(property);
SearchResult result = ds.FindOne();
}
}
当我检查result
对象数据,我只看到2个值:“homemta”和“adspath”。 “homeDirectory”值在哪里?
我进入AD网站和搜索相同的用户相同的价值观 - 通过网站,我可以看到我的所有搜索,所以我假设我的代码问题的地方的数据。
我在做什么错?