Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
FindOne Method
Collapse the table of content
Expand the table of content

DirectorySearcher.FindOne Method

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

Namespace:  System.DirectoryServices
Assembly:  System.DirectoryServices (in System.DirectoryServices.dll)

public SearchResult FindOne()

Return Value

Type: System.DirectoryServices.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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft