DirectoryEntry.MoveTo Method (DirectoryEntry, String)

 
System_CAPS_noteNote

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

Moves this DirectoryEntry object to the specified parent and changes its name to the specified value.

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

public void MoveTo(
	DirectoryEntry newParent,
	string newName
)

Parameters

newParent
Type: System.DirectoryServices.DirectoryEntry

The parent to which you want to move this entry.

newName
Type: System.String

The new name of this entry.

Exception Condition
InvalidOperationException

The specified DirectoryEntry is not a container.

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

.NET Framework
Available since 1.1
Return to top
Show: