This documentation is archived and is not being maintained.

DirectorySearcher.FindOne Method

Executes the search and returns only the first entry found.

[Visual Basic]
Public Function FindOne() As SearchResult
public SearchResult FindOne();
public: SearchResult* FindOne();
public function FindOne() : SearchResult;

Return Value

A SearchResult that is the first entry 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.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

DirectorySearcher Class | DirectorySearcher Members | System.DirectoryServices Namespace | SearchResult