IBM OS/2 LAN Server REXX Utility DLL


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


NETUSER2 Add


The function creates a user account entry with more parameters available 
for setting during creation.   
Syntax 


MyRc = NetAdd(NETUSER2, '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                    'Administrator'
     
     
     
   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 
   o userInfo.flags 
     The flags parameter determines whether a logon script is to be run 
     and whether the user account is enabled. The following values must be 
     used: 

     Value  Meaning
     -----  -------
       S    Must be set. Logon script enabled
       D    User account disabled
       U    User account cannot be deleted
       H    Home directory required
       N    Password not required
       C    User cannot change password
     
     
     
     You can combine flags by adding the values into a string of values 
   o userInfo.auth_flags 
     The authorization flags parameter grants operator privileges 
     (accounts, print, comm, server) to the userid. The following values 
     can be used: 

     Value  Meaning
     -----  -------
       P    Print operator privilege is enabled
       C    Comm operator privilege is enabled
       S    Server operator privilege is enabled
       A    Accounts operator privilege is enabled
     
     
     
     You can combine operator privileges by adding the values into a 
     string 
   o userInfo.full_name 
     The full name of the user account 
   o userInfo.usr_comment 
     A string that is a user settable field 
   o userInfo.script_path 
     The name of the logon script together with the path specification 
     relative to the NETLOGON SCRIPT parameter 
   o userInfo.max_storage 
     The maximum storage allotted for the home directory. The units are 
     kilobytes (KB). An entry of 0xFFFFFFFF or (-1) means unlimited 
     storage. The default is -1. 
     You can also specify "No Limit" 
   o userInfo.logon_server 
     An string that contains the name of the preferred server that 
     validates user logon requests for this userid. The server computer 
     name should be preceded by a double backslash (\\) and should be the 
     name of a domain controller or backup server on the domain. A server 
     computer name of an asterisk (\\*) indicates that the logon request 
     can be handled by any domain controller or backup on the domain, this 
     is the default setting 
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 using extended call */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETUSER2 = 282
SrvName  = '\\DOMAIN_CONTRLR'

userInfo.name        = 'WS2222'
userInfo.password    = 'PASSWORD'
userInfo.priv        = 'User'
userInfo.home_dir    = ''
userInfo.comment     = 'WS2221 user on new domain controller'
userInfo.flags       = 'S'
userInfo.auth_flags  = 'PC'
userInfo.full_name   = 'Peter The Great'
userInfo.usr_comment = 'Your Comment'
userInfo.script_path = 'HELLO.CMD'
userInfo.max_storage = 1000
userInfo.logon_server= '\\*'

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

if myRc <> '0' then do
 say 'Got error from NetAdd() ' myRc
 exitRc = 9
end
else do
 say 'Userid defined successfully'
 say
 exitRc = 0
end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit exitRc

  
Example Output   


Userid defined successfully



Inf-HTML End Run - Successful