Using PrincipalSearcher to find users with “or” parameters

前端 未结 5 1859
情歌与酒
情歌与酒 2020-12-30 20:07

Is it possible to use System.DirectoryServices.AccountManagement.PrincipalSearcher to search based on multiple parameters using \"or\" (not \"and\").

i.

5条回答
  •  醉酒成梦
    2020-12-30 20:47

    The FindAll method searches the domain specified in the principal context for objects that have identical properties to those set on the query filter. The FindAll method returns all objects that match the supplied object whereas the FindOne method returns only a single matching principal object. http://msdn.microsoft.com/en-us/library/bb384378(v=vs.90).aspx

    I don't know what you need, but you could do a search by 1 proprety and 1 by other and then use LINQ on the lists to merge,filter and etc...

提交回复
热议问题