The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy.
public ref class DirectoryEntry : System::ComponentModel::Component
[System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.Design.DirectoryEntryConverter))] [System.DirectoryServices.DSDescription("DirectoryEntryDesc")] [System.ComponentModel.TypeConverter(typeof(System.DirectoryServices.DirectoryEntryConverter))] public class DirectoryEntry : System.ComponentModel.Component
type DirectoryEntry = class inherit Component
Public Class DirectoryEntry Inherits Component
Use this class for binding to objects, or reading and updating attributes. DirectoryEntry, along with helper classes, provides support for life-cycle management and navigation methods. These include creating, deleting, renaming, moving a child node, and enumerating children. After you modify a node, you must commit your changes in order for them to be saved to the tree. For more information, see the CommitChanges property.
DirectoryEntry can be used to access regular entries and some, but not all, information from schema entries.
The Active Directory Domain Services hierarchy contains up to several thousand nodes. Each node represents an object, such as a network printer or a user in a domain. Corporate networks constantly change as new employees are hired and objects such as network printers and computers are added. Active Directory Service Interfaces (ADSI) technology provides ways to programmatically add these objects to the directory tree.
To create a directory entry in the hierarchy, use the Children property. The Children property is a collection that provides an Add method, through which you add a node to the collection directly below the parent node that you are currently bound to. When adding a node to the collection, you must specify a name for the new node and the name of a schema template that you want to associate with the node. For example, you might want to use a schema titled "Computer" to add new computers to the hierarchy.
This class also contains attribute caching, which can be useful for optimizing network traffic. To use attribute caching, see the UsePropertyCache property.
The classes associated with the DirectoryEntry component can be used with any of the Active Directory Domain Services service providers. Some of the current providers are Internet Information Services (IIS), Lightweight Directory Access Protocol (LDAP), Novell NetWare Directory Service (NDS), and WinNT.
It is assumed that you have a general understanding of Active Directory Domain Services before using this class. For more information, see the System.DirectoryServices namespace overview.
|AuthenticationType AuthenticationType AuthenticationType AuthenticationType||
Gets or sets the type of authentication to use.
|CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents||
Gets a value indicating whether the component can raise an event.(Inherited from Component)
|Children Children Children Children||
Gets the child entries of this node in the Active Directory Domain Services hierarchy.
|Container Container Container Container||Component)|
|DesignMode DesignMode DesignMode DesignMode||
Gets a value that indicates whether the Component is currently in design mode.(Inherited from Component)
|Events Events Events Events||
Gets the list of event handlers that are attached to this Component.(Inherited from Component)
|Guid Guid Guid Guid||
Gets the GUID of the DirectoryEntry.
|Name Name Name Name||
Gets the name of the object as named with the underlying directory service.
|NativeGuid NativeGuid NativeGuid NativeGuid||
Gets the GUID of the DirectoryEntry, as returned from the provider.
|NativeObject NativeObject NativeObject NativeObject||
Gets the native Active Directory Service Interfaces (ADSI) object.
|ObjectSecurity ObjectSecurity ObjectSecurity ObjectSecurity||
Gets or sets the security descriptor for this entry.
|Options Options Options Options||
Gets the provider-specific options for this entry.
|Parent Parent Parent Parent||
Gets this entry's parent in the Active Directory Domain Services hierarchy.
|Password Password Password Password||
Sets the password to use when authenticating the client.
|Path Path Path Path||
Gets or sets the path for this DirectoryEntry.
|Properties Properties Properties Properties||
Gets the Active Directory Domain Services properties for this DirectoryEntry object.
|SchemaClassName SchemaClassName SchemaClassName SchemaClassName||
Gets the name of the schema class for this DirectoryEntry object.
|SchemaEntry SchemaEntry SchemaEntry SchemaEntry||
Gets the schema object for this entry.
|Site Site Site Site||Component)|
|UsePropertyCache UsePropertyCache UsePropertyCache UsePropertyCache||
Gets or sets a value indicating whether the cache should be committed after each operation.
|Username Username Username Username||
Gets or sets the user name to use when authenticating the client.
|Disposed Disposed Disposed Disposed||
Occurs when the component is disposed by a call to the Dispose() method.(Inherited from Component)