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:
The destination domain should be trusted by the source domain. This implies that the destination domain should be in the list of trusted domains of the source domain.
The user performing this operation should be an administrator on the source domain, destination domain and the computer being moved.
After a computer is moved from one domain to another, you need to restart that computer for the changes to take effect.
Example
Dim ContainerObject As IADsContainer
Dim UserName As IADsUser
Set ContainerObject = GetObject("NTDS://YourDomainName")
Set UserName =
ContainerObject.MoveHere("NTDS://SrcDomainName/UserName",
"NewName")
See Also