Share via


DirectoryEntry.MoveTo (DirectoryEntry)

The MoveTo method moves this entry to the specified parent.

public void MoveTo(
  DirectoryEntry newParent
);
Public Sub MoveTo( _
  ByVal newParent As DirectoryEntry _
)

Parameters

  • newParent
    The parent to which you want to move this entry.

Return Values

This method has no return values.

Exceptions

Exception type Condition
InvalidOperationException The specified DirectoryEntry is not a container.

Security

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries From Partially Trusted Code.

Remarks

If UsePropertyCache is true, be sure to call CommitChanges on the new object to make the move permanent.

Requirements

Client Requires Windows XP Home Edition, Windows XP Professional, Windows Me, or Windows 98.
Server Requires Windows Server 2003, Windows 2000, or Windows NT 4.0.
Namespace

Defined in System.DirectoryServices.

Assembly

Requires System.DirectoryServices (in System.DirectoryServices.dll).

.NET Framework

Requires .NET Framework 1.0.

See Also

DirectoryEntry Class, DirectoryEntry Members, System.DirectoryServices Namespace, DirectoryEntry Members (Visual J# Syntax), Managed Extensions for C++ Programming