Clearing all servers from a group

Clearing all servers is a quick way to remove all the servers added to a server group. You use the ServerGroup.Servers.Clear method. he Clear method does not requires any parameters; you only need to query for the server group to clear. The following function clears all the servers from a given group.

Example

function ClearServerGroupMember(IStore, ServerGroupId)

{

    var ServerGroups = IStore.Query("SELECT SI_GROUP_MEMBERS FROM CI_SYSTEMOBJECTS WHERE SI_ID="+ServerGroupId);

    ServerGroup = ServerGroups.Item(1).PluginInterface("");

    ServerGroup.Servers.Clear();

    IStore.Commit(ServerGroups);

}

Next: Adding a group associate to a server group.



Crystal Decisions, Inc.
http://www.crystaldecisions.com
Support services:
http://support.crystaldecisions.com