DirectorySearcher.FindOne Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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
Available since 1.1
Return to top
Show: