IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NETUSERGROUPS Get Info


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 NetEnumerate(NETUSERGROUPS).   
Syntax 


MyRc = NetGetInfo(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 name 
SrvName           The server computer name of the domain controller 
UserId            The name of the userid 
  
Note 
The server computer name can be specified as '' for a local domain 
controller   
Example   


/* Get the groups in which a user is defined */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETUSERGROUPS = 330
SrvName = '\\ILIDC'
UserId = 'FMAM'

myRc = NetGetInfo(NETUSERGROUPS, 'userGroups', SrvName, UserId)

if myRc <> '0' then do
 say 'Got error from NetGetInfo() ' 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:  3

Group Name:  MANAGERS
Group Name:  HR_PRINT
Group Name:  USERS



Inf-HTML End Run - Successful