0.9b (c) 1995 Peter Childs
The function retrieves information about a particular user account on a server.
Syntax
MyRc = NetGetInfo(NETUSER, 'userInfo', SrvName, UserId)
Parameters
The parameters specified are:
'userInfo' The REXX variable receiving the result. The variable is divided into:
o userInfo.name
The user account name
o userInfo.password_age
The password age in seconds
o userInfo.priv
The user account privilege level. The following values are returned:
Account type Value ------------ ----- Guest 'Guest' User 'User' Administrator 'Admin'
o userInfo.home_dir
The user home directory, if one is specified
o userInfo.comment
The user account comment
o userInfo.flags
User account flags. See below for the values returned in a string:
Value Meaning ----- ------- S Always 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
o userInfo.script_path
The name of the logon script together with the path specification relative to the NETLOGON SCRIPT parameter
o userInfo.auth_flags
Grants operator privilege (accounts, print, comm, and server) to users. See below for the character values returned:
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
The string can be empty
o userInfo.full_name
The full name of the user
o userInfo.usr_comment
The account comment which is a user-settable comment
o userInfo.parms
The user account parameters
o userInfo.workstations
The workstation restriction for the user
o userInfo.last_logon
The last logon time
o userInfo.last_logoff
The last logoff time
o userInfo.acct_expires
The time the user account expires
o userInfo.max_storage
The maximum storage allotted for the home directory
o userInfo.units_per_week
The number of hours within a week (7 * 24 = 168)
o userInfo.restricted_hours
Logon restriction on certain hours
o userInfo.i.logon_hours
The logon hours allowed. 0 means 0 to 0:59, 1 1:00 to 1:59. The variable i has a value from 1 to 7, where 1 is Sunday, 2 Monday etc.. The logon_hours are only valid if userInfo.restricted_hours differs from the value '-none-'
o userInfo.bad_pw_count
The number of attempts to validate a bad password
o userInfo.num_logons
The number of successful logons
o userInfo.logon_server
The computer to handle logon requests for a user account
o userInfo.country_code
The country code for the user
o userInfo.code_page
The country code page for the user
SrvName The server compter 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 user account information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSER = 280 SrvName = '\\ILIDC' UserId = 'FMAM' myRc = NetGetInfo(NETUSER, 'userInfo', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'The account name: ' userInfo.name say 'Comment: ' userInfo.comment say 'User comment: ' userInfo.usr_comment say 'Full name: ' userInfo.full_name say 'Account privilege: ' userInfo.priv say 'Password age: ' userInfo.password_age say 'Home directory: ' userInfo.home_dir say 'User parameters: ' userInfo.parms say 'Last logon: ' userInfo.last_logon say 'Last logoff: ' userInfo.last_logoff say 'Bad password count: ' userInfo.bad_pw_count say 'Number logons: ' userInfo.num_logons say 'Logon Server: ' userInfo.logon_server say 'Country Code: ' userInfo.country_code say 'Code page: ' userInfo.code_page say 'Workstations allowed: ' userInfo.workstations say 'Auth_flags: ' userInfo.auth_flags say 'Account Flags: ' userInfo.flags say 'Max. disk storage: ' userInfo.max_storage say 'Hours per week: ' userInfo.units_per_week if userInfo.restricted_hours <> '-none-' then do say say 'Logon hours from Sunday = 1 to Saterday = 7' say do i=1 to 7 say 'Day: ' i 'Hours: ' userInfo.i.logon_hours end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0
Example Output
The account name: FMAM Comment: Section Manager in N91 User comment: -none- Full name: Section A Manager Mr Fm Am Account privilege: User Password age: 7445 Home directory: -none- User parameters: -none- Last logon: Unknown Last logoff: Unknown Bad password count: 1 Number logons: Unknown Logon Server: \\* Country Code: 000 Code page: 0 Workstations allowed: No Restriction Auth_flags: P Account Flags: S Max. disk storage: No Limit Hours per week: 168 Logon hours from Sunday = 1 to Saterday = 7 Day: 1 Hours: Day: 2 Hours: 8 9 10 11 12 13 14 15 16 17 Day: 3 Hours: 8 9 10 11 12 13 14 15 16 17 Day: 4 Hours: 8 9 10 11 12 13 14 15 16 17 Day: 5 Hours: 8 9 10 11 12 13 14 15 16 17 Day: 6 Hours: 8 9 10 11 12 13 14 15 16 17 Day: 7 Hours:
Inf-HTML End Run - Successful