IADsContainer Method: MoveHere

MoveHere
(
 SourceObject As String,
 NewName As String
) As IADs;

Parameters

[in] String SourceObject
ADsPath of the source object (Group, User, Local group or Local User) to be moved.

[in] String NewName
New name for the moved object. If the string is empty, the name of the source object is retained.

Description
Moves the given object to the current container.
The CopyHere property for IADsContainer supports copying of the following objects:

Domain

User, Group and Computer

Computer

User and Group

File

Directories and Files

Registry

Registry Keys and Registry Values

Return Values
The newly moved object.

Remarks
Moving a computer object to a domain container has the following prerequisites:

Example

Dim ContainerObject As IADsContainer
Dim UserName As IADsUser
Set ContainerObject = GetObject("NTDS://YourDomainName")
Set UserName = ContainerObject.MoveHere("NTDS://SrcDomainName/UserName", "NewName")

 

See Also