4.1.5 Add a Machine to a Machine Group

  1. Connect to the WSRM server by creating a ResourceManager COM object.

  2.  Get a pointer to the IWRMMachineGroup interface.

  3. Call the GetMachineGroupInfo method to identify the name of the machine group under which the machine will be added.

  4. Call the AddMachine method with the following parameters:

    • bstrParentMachineGroupId set to the name of the machine group to which the machine will be added.

    • bstrMachineInfo set to the machine to be added, in the format of a Machine element (section 2.2.5.17).

  5. Release the pointer to the interface.