0.9b (c) 1995 Peter Childs
The function validates a user account with its password, and checks whether there are any logon restrictions for this user account. If the specified user account is not found, this function attempts to validate the guest account, instead. If this happens, all verification checks will be based only on the guest account.
Syntax
MyRc = NetMisc(NETUSERVALIDATE2, 'userInfo', userId, passWord, DcName)
Parameters
The parameters returned are:
'userInfo' The REXX variable receiving the result. The variable is divided into:
o userInfo.code
The response from the function call, according to the following values:
Value Meaning ----- ------- 0 No errors were encountered 5 The username and password do not correspond to an active account 2217 The logon server could not validate the logon 2240 The user is not allowed to log on from this requester 2241 The user is not allowed to log on at this time 2242 The password has expired
o userInfo.priv
The user account privilege level. The following values are returned:
Value Meaning ----- ------- 0 Guest 1 User 2 Administrator
userId The user account name
passWord The password for the user account
DcName The computer name of a domain controller
Example
/* Net User Validate2 */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERVALIDATE2 = 500 UserId = 'USER04' passWord = 'PASSWORD' DcName = '\\ANYSRV01' myRc = NetMisc(NETUSERVALIDATE2, 'userInfo', Userid, passWord, DcName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Userid validated successfully' say 'Function code' userInfo.code say 'Privilege ' userInfo.priv exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc
Example Output
Userid validated successfully Function code 0 Privilege 1
Inf-HTML End Run - Successful