This documentation is archived and is not being maintained.
DirectoryEntry::CopyTo Method (DirectoryEntry, String)
Visual Studio 2010
Creates a copy of this DirectoryEntry object, as a child of the specified parent DirectoryEntry object, with the specified new name.
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
Parameters
- newParent
- Type: System.DirectoryServices::DirectoryEntry
The DN of the DirectoryEntry object that will be the parent for the copy that is being created.
- newName
- Type: System::String
The name of the copy of this entry.
Return Value
Type: System.DirectoryServices::DirectoryEntryA renamed copy of this entry as a child of the specified parent.
| Exception | Condition |
|---|---|
| InvalidOperationException | The specified DirectoryEntry object is not a container. |
The Lightweight Directory Access Protocol (LDAP) provider does not currently support this method.
If UsePropertyCache is true, call CommitChanges on the new object to make the copy permanent.
- DirectoryServicesPermission
To make a copy of the entry.
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: