Group Functions

The group functions control global groups. A global group contains a number of user accounts from one domain that are grouped together under one group account name. A global group can contain only members from the domain where the global group is created. A global group can contain only user accounts; it cannot contain local groups or other global groups. The group functions are:

NetGroupAdd
NetGroupAddUser
NetGroupDel
NetGroupDelUser
NetGroupEnum
NetGroupGetInfo
NetGroupGetUsers
NetGroupSetInfo
NetGroupSetUsers

To create a group, an application calls NetGroupAdd, supplying a group name. Initially, the group has no members. To assign members to the group, call NetGroupSetUsers. To add a user to an existing global group, call NetGroupAddUser. To set general information about the global group, call NetGroupSetInfo.

The NetGroupDelUser function deletes a specified user name from a group, and NetGroupDel destroys a group. The NetGroupDel function works whether or not the group has any members.

Three group functions retrieve information about the groups on a server: NetGroupEnum produces a list of all groups; NetGroupGetUsers lists all members of a specified group; and NetGroupGetInfo returns general information about the group. Each user account automatically belongs to one of the special global groups Domain Users or None, according to the user's security requirements. Membership of these groups is indirectly controlled by the NetUserAdd, NetUserDel, and NetUserSetInfo functions.

Group account information is available at three levels:

GROUP_INFO_0
GROUP_INFO_1

GROUP_INFO_2

The groups to which a user belongs may be obtained at two information levels.

GROUP_USERS_INFO_0
GROUP_USERS_INFO_1

The following information levels are valid only for NetGroupSetInfo.

GROUP_INFO_1002
GROUP_INFO_1005

For NetGroupSetInfo, parmnum values refer to the members of the GROUP_INFO structure as follows. These values are used when indicating an error in a specific parameter through parm_err.

parmnum value Member of GROUP_INFO structure
GROUP_NAME_PARMNUM grpi_name
GROUP_COMMENT_PARMNUM grpi_comment
GROUP_ATTRIBUTES_PARMNUM grpi_attributes