0.9b (c) 1995 Peter Childs
The function lists the names of all groups in the user accounts subsystem (UAS) database to which a particular user account belongs. This function is identical to NetGetInfo(NETUSERGROUPS).
Syntax
MyRc = NetEnumerate(NETUSERGROUPS, 'userGroups', SrvName, UserId)
Parameters
The parameters specified are:
'userGroups' The REXX variable receiving the result. The variable is divided into:
o userGroups.0
The number of groups in which the user account has a entry
o userGroups.i
The actual group names
o userGroups.totalentries
The total number of entries available. If many entries are avaiable the number of entries returned (userGroups.0) is not identical to the total numbers available
SrvName The server computer name
UserId The userid
Note
The server computer name can be specified as '' for a local server or computer.
Example
/* Get the groups in which a user account is defined */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERGROUPS = 330 SrvName = '\\DOMAIN_CONTRLR' UserId = 'USERID' myRc = NetEnumerate(NETUSERGROUPS, 'userGroups', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if userGroups.0 = 0 then do say 'User account belongs to no group' call DropLsRxutFuncs exit 0 end say 'Number of entries: ' userGroups.0 say do i=1 to userGroups.0 say 'Group Name: ' userGroups.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
Number of entries: 1 Group Name: ADMINS
Inf-HTML End Run - Successful