Platform SDK: Active Directory, ADSI, and Directory Services

Moving Groups

Groups can be moved within a domain.

However, you can only move objects between domains using the movetree.exe utility and then using that utility only universal groups can be moved from one domain to another. A global or domain local group can be converted to a universal group, moved to another domain, and converted back again.

To move a group

  1. Bind to the group to move and get an IADs pointer.
  2. Get the ADsPath using the IADs::get_ADsPath property method. The ADsPath will be used to specify the group to move.
  3. Bind to the container object where you want to move the group to and get an IADsContainer pointer.
  4. Move the group using the IADsContainer::MoveHere method.

    If you have a pointer to the group object before it was moved, the pointer to the object is still valid, but the object's methods is no longer valid because the directory object it represents is no longer valid.