Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

DirectoryEntry.CopyTo Method (DirectoryEntry)

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
)

Parameters

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.

ExceptionCondition
InvalidOperationException

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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft