IBM OS/2 LAN Server REXX Utility DLL


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


NETUSER Enumerate


The function retrieves a list of defined user accounts on a server.   
Syntax 

MyRc = NetEnumerate(NETUSER, 'userInfo', SrvName)

  
Parameters 
The parameters specified are: 
'userInfo'        The REXX variable receiving the result. The variable is 
                  divided into: 
   o userInfo.0 
     The number of users 
   o userInfo.i 
     User name entry i, where the variable i has a value from 1 to 
     userInfo.0 
   o userInfo.totalentries 
     The total number of entries available. If many entries are defined 
     the number of entries returned (userInfo.0) is not identical to the 
     total number of available entries 
SrvName           The server computer name of the domain controller 
  
Note 
The server computer name can be specified as '' for a local domain 
controller. 
Example   

/* List defined user accounts in the UAS */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETUSER = 280
SrvName = '\\DOMAIN_CONTRLR'

myRc = NetEnumerate(NETUSER, 'userInfo', SrvName)

if myRc <> '0' then do
 say 'Got error from NetEnumerate() ' myRc
 call DropLsRxutFuncs
 exit 9
end

if userInfo.0 = 0 then do
 say 'No user accounts defined'
 call DropLsRxutFuncs
 exit 0
end

say 'Number of users defined: ' userInfo.0
say

do i=1 to userInfo.0
 say userInfo.i
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   

Number of users defined:  12

GUEST
ADDITIONAL_SRV
DOMAIN_CONTRLR
A948R11
USERID
ADMIN04
A948R9
DIESEISTEINSEHRLANGE
A948R1
USER04
ADMIN
DOSUSER



Inf-HTML End Run - Successful