TechNet
Export (0) Print
Expand All

DirectoryEntry Class

 

The DirectoryEntry class encapsulates a node or object in the Active Directory Domain Services hierarchy.

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

System.Object
  System.MarshalByRefObject
    System.ComponentModel.Component
      System.DirectoryServices.DirectoryEntry

[DSDescriptionAttribute("DirectoryEntryDesc")]
[DirectoryServicesPermissionAttribute(SecurityAction.LinkDemand, 
	Unrestricted = true)]
[EnvironmentPermissionAttribute(SecurityAction.Assert, Unrestricted = true)]
[SecurityPermissionAttribute(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]
public class DirectoryEntry : Component

NameDescription
System_CAPS_pubmethodDirectoryEntry()

Initializes a new instance of the DirectoryEntry class.

System_CAPS_pubmethodDirectoryEntry(Object)

Initializes a new instance of the DirectoryEntry class that binds to the specified native Active Directory Domain Services object.

System_CAPS_pubmethodDirectoryEntry(String)

Initializes a new instance of the DirectoryEntry class that binds this instance to the node in Active Directory Domain Services located at the specified path.

System_CAPS_pubmethodDirectoryEntry(String, String, String)

Initializes a new instance of the DirectoryEntry class.

System_CAPS_pubmethodDirectoryEntry(String, String, String, AuthenticationTypes)

Initializes a new instance of the DirectoryEntry class.

NameDescription
System_CAPS_pubpropertyAuthenticationType

Gets or sets the type of authentication to use.

System_CAPS_protpropertyCanRaiseEvents

Gets a value indicating whether the component can raise an event.(Inherited from Component.)

System_CAPS_pubpropertyChildren

Gets the child entries of this node in the Active Directory Domain Services hierarchy.

System_CAPS_pubpropertyContainer

Gets the IContainer that contains the Component.(Inherited from Component.)

System_CAPS_protpropertyDesignMode

Gets a value that indicates whether the Component is currently in design mode.(Inherited from Component.)

System_CAPS_protpropertyEvents

Gets the list of event handlers that are attached to this Component.(Inherited from Component.)

System_CAPS_pubpropertyGuid

Gets the GUID of the DirectoryEntry.

System_CAPS_pubpropertyName

Gets the name of the object as named with the underlying directory service.

System_CAPS_pubpropertyNativeGuid

Gets the GUID of the DirectoryEntry, as returned from the provider.

System_CAPS_pubpropertyNativeObject

Gets the native Active Directory Service Interfaces (ADSI) object.

System_CAPS_pubpropertyObjectSecurity

Gets or sets the security descriptor for this entry.

System_CAPS_pubpropertyOptions

Gets the provider-specific options for this entry.

System_CAPS_pubpropertyParent

Gets this entry's parent in the Active Directory Domain Services hierarchy.

System_CAPS_pubpropertyPassword

Sets the password to use when authenticating the client.

System_CAPS_pubpropertyPath

Gets or sets the path for this DirectoryEntry.

System_CAPS_pubpropertyProperties

Gets the Active Directory Domain Services properties for this DirectoryEntry object.

System_CAPS_pubpropertySchemaClassName

Gets the name of the schema class for this DirectoryEntry object.

System_CAPS_pubpropertySchemaEntry

Gets the schema object for this entry.

System_CAPS_pubpropertySite

Gets or sets the ISite of the Component.(Inherited from Component.)

System_CAPS_pubpropertyUsePropertyCache

Gets or sets a value indicating whether the cache should be committed after each operation.

System_CAPS_pubpropertyUsername

Gets or sets the user name to use when authenticating the client.

NameDescription
System_CAPS_pubmethodClose()

Closes the DirectoryEntry object and releases any system resources that are associated with this component.

System_CAPS_pubmethodCommitChanges()

Saves changes that are made to a directory entry to the underlying directory store.

System_CAPS_pubmethodCopyTo(DirectoryEntry)

Creates a copy of this entry as a child of the specified parent.

System_CAPS_pubmethodCopyTo(DirectoryEntry, String)

Creates a copy of this DirectoryEntry object, as a child of the specified parent DirectoryEntry object, with the specified new name.

System_CAPS_pubmethodCreateObjRef(Type)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDeleteTree()

Deletes this entry and its entire subtree from the Active Directory Domain Services hierarchy.

System_CAPS_pubmethodDispose()

Releases all resources used by the Component.(Inherited from Component.)

System_CAPS_protmethodDispose(Boolean)

Disposes of the resources (other than memory) that are used by the DirectoryEntry.(Overrides Component.Dispose(Boolean).)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticExists(String)

Determines if the specified path represents an actual entry in the directory service.

System_CAPS_protmethodFinalize()

Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection.(Inherited from Component.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_protmethodGetService(Type)

Returns an object that represents a service provided by the Component or by its Container.(Inherited from Component.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodInvoke(String, Object[])

Calls a method on the native Active Directory Domain Services object.

System_CAPS_pubmethodInvokeGet(String)

Gets a property from the native Active Directory Domain Services object.

System_CAPS_pubmethodInvokeSet(String, Object[])

Sets a property on the native Active Directory Domain Services object.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodMoveTo(DirectoryEntry)

Moves this DirectoryEntry object to the specified parent.

System_CAPS_pubmethodMoveTo(DirectoryEntry, String)

Moves this DirectoryEntry object to the specified parent and changes its name to the specified value.

System_CAPS_pubmethodRefreshCache()

Loads the property values for this DirectoryEntry object into the property cache.

System_CAPS_pubmethodRefreshCache(String[])

Loads the values of the specified properties into the property cache.

System_CAPS_pubmethodRename(String)

Changes the name of this DirectoryEntry object.

System_CAPS_pubmethodToString()

Returns a String containing the name of the Component, if any. This method should not be overridden.(Inherited from Component.)

NameDescription
System_CAPS_pubeventDisposed

Occurs when the component is disposed by a call to the Dispose method. (Inherited from 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.

System_CAPS_noteNote

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.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft