DirectoryEntries.Find Method (String)

 
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.

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
)

Parameters

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
InvalidOperationException

The Active Directory Domain Services object is not a container.

COMException

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.

System_CAPS_noteNote

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
Show: