This documentation is archived and is not being maintained.
DirectoryEntry::CopyTo Method (DirectoryEntry)
Visual Studio 2010
Creates a copy of this entry as a child of the specified parent.
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
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::DirectoryEntryA DirectoryEntry object that represents the copy of this entry as a child of the new parent.
| Exception | Condition |
|---|---|
| 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.
- DirectoryServicesPermission
To make a copy of the specified DirectoryEntry object.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: