繁体   English   中英

DirectorySearcher 找不到传真属性

[英]DirectorySearcher can't find fax property

我正在使用DirectorySearcher查找有关当前用户的详细信息。

UserPrincipal u = UserPrincipal.Current;
DirectoryEntry? user = u.GetUnderlyingObject() as DirectoryEntry;
DirectorySearcher ds = new DirectorySearcher(user);
ds.PropertiesToLoad.AddRange(new[]
{
    "fax", "displayName", "streetAddress", "department", "telephoneNumber"
});
var entry = ds.FindOne();

“传真”不在Property集合中

我确认该值是在 AD 中设置的。

Powershell显示正确

PS C:\Users\Henrik Halbritter> get-aduser "Henrik Halbritter" -Property "fax" | select -Property fax

fax
---
0123456

而不是fax ,请尝试FacsimileTelephoneNumber AD 属性名称的引用方式可能非常不一致。

暂无
暂无

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

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