DirectoryEntry.CopyTo Method (DirectoryEntry)


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

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

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

public DirectoryEntry CopyTo(
	DirectoryEntry newParent


Type: System.DirectoryServices.DirectoryEntry

The distinguished name of the DirectoryEntry object that will be the parent for the copy that is being created.

Return Value

Type: System.DirectoryServices.DirectoryEntry

A DirectoryEntry object that represents the copy of this entry as a child of the new parent.

Exception Condition

The specified DirectoryEntry is not a container.

If UsePropertyCache is true, call CommitChanges on the new object to make the copy permanent.

The Lightweight Directory Access Protocol (LDAP) provider does not currently support the CopyTo(DirectoryEntry) method.


To make a copy of the specified DirectoryEntry object.

.NET Framework
Available since 1.1
Return to top