DirectoryEntries.Find Method (String)


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

Returns the member of this collection with the specified name.

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

public DirectoryEntry Find(
	string name


Type: System.String

Contains the name of the child object for which to search.

Return Value

Type: System.DirectoryServices.DirectoryEntry

A DirectoryEntry that represents the child object that was found.

Exception Condition

The Active Directory Domain Services object is not a container.


An error occurred during the call to the underlying interface.

If child objects of different types have the same name, the first matching child object is returned.


The Internet Information Services (IIS) provider does not support this method. Use the overloaded Find method and specify an empty string ("") for the schemaClassName parameter.

If no matching result is found, a DirectoryServicesCOMException with error code 0x2030 is thrown.

.NET Framework
Available since 1.1
Return to top