没有IdentityType的UserPrincipal.FindByIdentity

时间:2016-09-21 15:56:53

标签: c# ldap ldap-query

我发现你可以使用或不使用IdentityType参数调用FindByIdentity方法

https://msdn.microsoft.com/en-us/library/system.directoryservices.accountmanagement.userprincipal.findbyidentity(v=vs.110).aspx

我在这里发现,如果你包含IdentityType.Name,它会搜索AD中的CN字段,IdentityType.SamAccountName是不言自明的。

我们的代码不包含IdentityType.name参数。

UserPrincipal user = UserPrincipal.FindByIdentity(context,“00471”);

在AD中搜索哪些字段?

对于大多数搜索,这对我们来说非常合适。我刚刚遇到一个错误错误的搜索,它返回了多个结果。不知道它在搜索哪些字段我无法弄清楚它是如何找到的。

提前致谢。

0 个答案:

没有答案
相关问题