IBM OS/2 LAN Server REXX Utility DLL


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


NETUSER Add


The function adds a user account.   
Syntax 


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

  
Parameters 
The parameters required are: 
'userInfo'  The REXX variable holding the user account information. The 
            variable is divided into: 
   o userInfo.name 
     The userid account name 
   o userInfo.password 
     The userid account password 
   o userInfo.priv 
     The userid account privilege level. The following values can be used: 
     

     Account type                     Value
     ------------                     -----
     Guest                            'Guest'
     
     User                             'User'
     
     Administrator                    'Admin'
     
     
     
   o userInfo.home_dir 
     The path to the userid home directory, if any. The following rules 
     apply: 
     This string can take one of two forms. The first form defines the 
     drive of the user that will be assigned to the home directory. It can 
     have as many as 260 bytes. 

     
     x:\machineID\y$\pathname
     
     
     
     where x is the drive letter to be assigned, machineID is the name of 
     the server that holds the home directory, y is the driver letter on 
     the server where the home directory exists, and pathname is the 
     remaining path to the directory. 
     The second form defines a first available drive specification for the 
     name directory: 

     
     \\machineID\y$\pathname
     
     
     
     where machineID, y, and pathname are defined as in the preceding 
     example. To define a home directory at the root of a server's drive, 
     omit \pathname from either of the forms previously mentioned. 
     It is important to ensure that this field follows the correct format 
     or users may not get their home directory at logon time. An access 
     control profile must also be created, giving users access to the home 
     directory. 
   o userInfo.comment 
     The user account comment 
SrvName     The server computer name of the domain controller 
  
Note 
The server computer name can be specified as '' for a local domain 
controller.   
Example   


/* Add a userid */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETUSER = 280
SrvName = '\\ILIDC'

userInfo.name        = 'WS2221'
userInfo.password    = 'PASSWORD'
userInfo.priv        = 'User'
userInfo.home_dir    = ''
userInfo.comment     = 'WS2221 user in location N91-3161'

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

if myRc <> '0' then do
 say 'Got error from NetAdd() ' myRc
 call DropLsRxutFuncs
 exit 9
end
else do
 say
 say "User created successfully"
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   


User created successfully



Inf-HTML End Run - Successful