The getgroups() function retrieves a list of all groups to which the specified user belongs. This information is taken from the /etc/groups file on the policy server host or the group map in NIS.

result = getgroups([user]);
user Optional. The name of the user for which the secondary group names should be retrieved. If this argument is not specified, then the value of the runuser variable is used.

A list of character strings that contains all of the groups that the user belongs to. An error is returned if the user is invalid or null.

result = getgroups(runuser);

For more information, please see getgroup.