# EssListGroups

Description

EssListGroups() lists all groups who have access to a particular Essbase server, application or database.

Syntax

    ESS_FUNC_M EssListGroups (hCtx, AppName, DbName, pCount, ppGroupList);

ESS_HCTX_T | hCtx
ESS_STR_T | AppName
ESS_STR_T | DbName
ESS_PUSHORT_T | pCount
ESS_PPGROUPINFO_T | ppGroupList

Parameters

hCtx | Essbase API context handle.
AppName | Application name. If NULL, lists all groups.
DbName | databasename. If NULL, lists groups for all databases within application.
pCount | Address of variable to receive count of groups.
ppGroupList | Address of pointer to receive an allocated array of group info structures.

Return Value

If successful, returns a count of the number of groups in pCount, and list of groups with access to the specified application and database in ppGroupList.

Notes

- If both AppName and DbName are not NULL, only groups with access to the specified application and database will be listed. If DbName is NULL, only groups with access to the specified application will be listed. If AppName is NULL, all groups on the logged in server will be listed.
- The memory allocated for ppGroupList should be freed using EssFree().

Access

This function requires no special privileges.

Example

    ESS_FUNC_M
    ESS_ListGroups (ESS_HCTX_T  hCtx,
                    ESS_HINST_T hInst
                   )
    {
       ESS_FUNC_M        sts = ESS_STS_NOERR;
       ESS_USHORT_T     Count;
       ESS_PGROUPINFO_T Groups = NULL;
       ESS_USHORT_T      ind;
       sts = EssListGroups (hCtx, NULL, NULL, &Count, &Groups);
       if (!sts)
       {
         if (Count && Groups)
         {
           printf ("\r\n-----Group List-----\r\n\r\n");
           for (ind = 0; ind < Count; ind++)
             printf ("Name->%s\r\n", Groups [ind].Name);
           EssFree (hInst, Groups);
         }
         else
           printf ("\r\nGroup List is Empty\r\n\r\n");
       }

      return (sts);
    }

See Also

EssGetGroup()
EssListUsers()