DirectorySearcher.FindOne Method


Executes the search and returns only the first entry that is found.

 System::DirectoryServices::SearchResult ^ FindOne();
public System.DirectoryServices.SearchResult FindOne ();
public System.DirectoryServices.SearchResult? FindOne ();
member this.FindOne : unit -> System.DirectoryServices.SearchResult
Public Function FindOne () As SearchResult


A SearchResult object that contains the first entry that is found during the search.


If more than one entry is found during the search, only the first entry is returned. If no entries are found to match the search criteria, a null reference (Nothing in Visual Basic) is returned.

Applies to

See also