═══ 1. Version Notice ═══ Third Edition (April 1996) The following paragraph does not apply to the United Kingdom or any country where such provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain transactions; therefore, this statement may not apply to you. This publication could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein; these changes will be incorporated in new editions of the publication. IBM may make improvements and/or changes in the product(s) and/or the program(s) described in this publication at any time. It is possible that this publication may contain reference to, or information about, IBM products (machines and programs), programming, or services that are not announced in your country. Such references or information must not be construed to mean that IBM intends to announce such IBM products, programming, or services in your country. Requests for copies of this publication and for technical information about IBM products should be made to your IBM Authorized Dealer or your IBM Marketing Representative. ═══ 2. Notices ═══ References in this publication to IBM products, programs, or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights or other legally projectable rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, programs, or services, except those expressly designated by IBM, are the user's responsibility. IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any rights to these patents. You can inquire, in writing, to IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY 10594, USA. Asia-Pacific users can inquire, in writing, to Intellectual Property and Licensing, IBM World Trade Asia Corporation, 2-31, Roppongi 3-chome, Minato-ku, Tokyo 106, Japan. The following terms, denoted by an asterisk (*) in this book, are trademarks of the IBM Corporation in the United States, or other countries, or both: IBM FFST/2 First Failure Support Technology/2 OS/2 Presentation Manager LAN Server ═══ 3. About This Book ═══ This is the documentation of the IBM OS/2 LAN Server* REXX Utility DLL file. The REXX interface to the LAN Server API functions was created for the LAN Server administrators, to assist them in the daily operation of the LAN Server. During the writing of the book "Automating IBM OS/2 LAN Server Administration", IBM Form number GG24-4442, we discovered the need for additional functions. The base version of the DLL (LS30UT.DLL) was therefore extended and renamed to LSRXUT.DLL, which now supports IBM OS/2 Warp Server, as well as versions 3.0 and 4.0 of the IBM OS/2 LAN Server. ═══ 3.1. LSRXUT.DLL History ═══ The major changes in the different versions are: Version 1.0.0 Closed March 9th. 1993. All functions are described in GG24-4043. Version 1.0.1 Added the functions Ls30utVer(), NetEnumerate() and NetGetInfo(). Added the LS30UTIL.INF file. It is a draft version. It contains spelling and wording errors. Version 1.0.2 Added the functions NetAdd(), NetDelete() and NetSetInfo(). An additional alert part was added using the IBM FASTService for OS/2, which of course, must be installed if used. A IBM LAN Server 3.0 controlling workstation can now together with FASTService for OS/2 and the addition of Remote Operations from either Extended Services or CM/2 perform operations under control of NetView. The NetView control is intended to be triggered by an alert, which will trigger a NetView CLIST that performs a RUNCMD against the IBM LAN Server 3.0 controlling workstation. Version 1.0.3 Bug fix in the function SetLogonAsn(). Was incorrectly handling a NetUserGetLogonAsn() return code resulting in the following return message SetLogonAsn returned 0 Could not get user Logon assignment in functions using SetLogonAsn(). Version 1.0.4 Bug fix. Same problem as in 1.0.3, but with application selectors. Added the functions: NetGetInfo(NETFINDADDRESS) to list LAN adapter address from a NetBIOS name NetSetInfo(NETEXPIREPASSWORD) to expire a password The LS30UT.DLL has been tested successfully with both VisPro/REXX and Watcom Visual REXX. Version 1.0.5 Minor cosmetic corrections in the LS30UTIL.INF documentation file. Added a more detailed description of the LS30UT.DLL base functions. Inserted a log entry for every userid successfully added in the base function InsertAllUsers(). Converted to the IBM C/C++ Tools 2.0 development environment. Added the function: NetSetInfo(NETHOMEDIR) to assign a home directory Version 1.0.6 Minor code changes in LS30UT.DLL. Compiled with the IBM C/C++ Tools Version at 2.01 level. The APAR PJ11200 was created to handle a Trap 000D in HELPMGR.DLL when doing copy to clipboard, file and print from the LS30UTIL.INF on some systems. Added the function NetAdd(NETUSERINITDCDB) to add a new userid and force the creation of the \IBMLAN\DCDB\USERS\userid directory. Version 1.0.7 Added the function: NetSetInfo(NETUSER) to supplement existing user account functions because of a requirement to set the maximum storage parameter from LS30UT.DLL. Also, the functions: RxSplCreateDevice() RxSplCreateQueue() RxSplDeleteDevice() RxSplDeleteQueue() RxSplEnumDevice() RxSplEnumDriver() RxSplEnumPort() RxSplEnumPrinter() RxSplQueryDevice() RxSplQueryQueue() where added. Version 1.0.8 Made a set of modifications in the source code to solve a thunk problem in the function NetAdd(NETALIAS) which may happen on some server and requester systems. The function NetAdd(NETAPP) had a problem with application types, which always was forced to 'PUBLIC OS/2'. Made the parameter 'auth_flags' available in the function NetGetInfo(NETUSER). The parameter 'auth_flags' can also be set in the function NetSetInfo(NETUSER). Also a problem with empty server specifications was discovered. This should be corrected in this version of the DLL. Added the following functions: RxSplControlDevice() RxSplDeleteJob() RxSplEnumJob() RxSplHoldJob() RxSplHoldQueue() RxSplPurgeQueue() RxSplQueryJob() RxSplReleaseJob() RxSplReleaseQueue() RxSplSetJob() Version 1.0.9 Missed the 'A' attribute for Access Control profiles. This has been added. Added a comment in the INF file regarding the use of LS30UT.DLL in multiple processes. See Using LSRXUT.DLL in multible processes. Version 1.0.10 A problem with many spooler printer devices was corrected. The functions NetEnumerate(NETFILE) and NetEnumerate(NETSESSION) was expanded on request and will return additional information. The function NetDelete(NETFILECLOSE) was added. Using the NetAdd(NETUSE) functions acts differently on the IBM LAN Server 3.0 versions IP07000, IP07001, IP07005 and IP07045. To ensure the function works as intended, the resource to be used must be shared at server startup. The command line NET USE makes use of another undocumented API to enable the use of a server resource which is shared at request. Version 1.0.11 Added user account flags into the NetSetInfo(NETUSER) function. If a user account is setup to have no password, the password required functions in LS30UT.DLL require a dummy password. The NetSetInfo(NETUSER) is enabled for password setting for an administrator. The NetSetInfo(NETGROUP) was added to set group comment. The NetEnumerate(NETUSE, NETCONNECTION, NETFILE) functions can now use the returned stem variable.0 as a counter for the number of items returned. A problem with NetSetInfo(NETALIAS, 'path') was discovered and corrected. Version 1.0.12 Added control on allocated memory. Version 1.0.13 Interim version Version 1.0.14 A TRAP D encountered. This is solved. Removed FASTService support. It does not work correctly in all REXX environments. Version 1.0.15 Interim version Version 1.0.18 Many Interim versions, each solving problems reported Version 2.0.0 Added support for IBM LAN Server 4.0 into the DLL. The DLL was renamed and the following functions where renamed: LS30UT.DLL LSRXUT.DLL ----------------- ----------------- LoadLs30utFuncs() LoadLsRxutFuncs() LsRx30Ver() LsRxutVer() DropLs30utFuncs() DropLsRxutFuncs() The following list is a incomplete list of additional functions added or functions modified: NetAdd(NETMESSAGENAME) New function NetAdd(NETUSER2) New function NetDelete(NETAPPSEL) New function NetDelete(NETLOGONASN) New function NetDelete(NETMESSAGENAME) New function NetEnumerate(NETAPP) Added a type parameter for the enumeration NetGetInfo(NETMESSAGELOGFILE) New function NetMisc(NETACCESSAPPLY) New function. This is only for LS40 NetMisc(NETACCESSCHECK) New function NetMisc(NETMESSAGEBUFFERSEND) New function NetMisc(NETMESSAGEFILESEND) New function NetMisc(NETMESSAGENAMEFWD) New function NetMisc(NETMESSAGENAMEUNFWD) New function NetMisc(NETREMOTECOPY) New function NetMisc(NETREMOTEMOVE) New function NetMisc(NETREMOTETOD) New function NetMisc(NETSERVERADMINCMD) New function NetMisc(NETUSERDCDBINIT) New function NetMisc(NETUSERVALIDATE2) New function NetSetInfo(NETALIAS) Can now change the server location of the resource. This is only for LS40 NetSetInfo(NETGROUPUSERS) New function NetSetInfo(NETMESSAGELOGFILE) New function NetSetInfo(NETUSER) Added more options NetSetInfo(NETUSERGROUPS) New function NetSetInfo(NETUSERMODALS) New function NetSetInfo(NETSERVERMODALS) New function Added NetDASD support for the 4.0 version of the DLL The control variables returning the value '-none-' has been changed for many of the functions. Please check with the function documentation if you have procedures based on the old version of the DLL. The source code was partially cleaned up to reduce the DLL size. Version 2.0.1 Password upper-cased when user account created. RxSplEnumQueue returns incorrect value. Version 2.0.2 Fixed trap in NetServerModals. Version 2.0.3 Fixed trap in NetGetInfo:NetAppSel. Version 2.0.4 NetSetInfo:NetUser now allows null homedir. ═══ 3.2. The Files ═══ The IBM OS/2 LAN Server Utility DLL package contains the following files: 1. The LSRXUTIL.INF file If you experience TRAP D messages in HELPMGR.DLL while doing copy to Clipboard, file or printing, you need to obtain the APAR PJ11200 for OS/2. 2. Two versions of the LSRXUT.DLL: a) LSRXUT4.DLL for Warp Server and Warp Connect clients, as well as LAN Server 4.0 based systems. It can be used to call Warp Server, Warp Connect, LAN Server 3.0, and LAN Server 4.0 systems. b) LSRXUT3.DLL for LAN Server 3.0 based systems ═══ 3.3. References ═══ The following documentation contains additional description of the parameters and values used and provided in the LSRXUT.DLL: IBM LAN Server Family Programming Reference IBM LAN Server 4.0 Application Programming Reference IBM LAN Server 3.0 Application Programming Reference IBM LAN Server 2.0 Application Programming Reference, but not for alias and application related calls Automating IBM OS/2 LAN Server Administration, IBM Form number GG24-4442 This book also contains the source code of the LSRXUT.DLL ═══ 4. How to use ═══ To use LSRXUT.DLL functions, OS/2 2.0 (or higher) and IBM LAN Server 3.0 (or higher) must be installed. Before you start, rename either the file LSRXUT3.DLL or LSRXUT4.DLL to LSRXUT.DLL. The LSRXUT.DLL must be copied to any subdirectory that is included in the CONFIG.SYS LIBPATH= parameter. To validate the correct installation of the LSRXUT.DLL the following REXX procedure can be used: /************************************************/ Say 'Testing LSRXUT.DLL access' call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs Say 'LoadLsRxutFuncs is complete.' version = LsRxutVer() say 'Version is ' version call DropLsRxutFuncs exit 0 An example output of the test function would be like the following: Testing LSRXUT.DLL access LoadLsRxutFuncs is complete. Version is 2.00.00 ═══ 5. LSRXUT.DLL Load and Drop ═══ To activate the functions of the LSRXUT.DLL a REXX call must be made to make REXX aware of the existence of the LSRXUT.DLL functions. A similar REXX call must be made to unload (drop) the function in the LSRXUT.DLL. To provide this, two functions are implemented. They are: LoadLsRxutFuncs() DropLsRxutFuncs() ═══ 5.1. DropLsRxutFuncs() ═══ This function drop all functions in LSRXUT.DLL Syntax call DropLsRxutFuncs Parameters none Note The call to the function DropLsRxutFuncs can be initiated after any use of the LSRXUT.DLL functions. Example /************************************************/ Say 'Testing LSRXUT.DLL access' call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs Say 'LoadLsRxutFuncs is complete.' version = LsRxutVer() say 'Version is ' version call DropLsRxutFuncs exit 0 Example output Testing LSRXUT.DLL access LoadLsRxutFuncs is complete. Version is 2.00.00 ═══ 5.2. LoadLsRxutFuncs() ═══ This function registers all functions in LSRXUT.DLL. Syntax call LoadLsRxutFuncs Parameters none Note The call to LoadLsRxutFuncs must be combined with the RxFuncAdd function. The correct sequence is: call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs Example /************************************************/ Say 'Testing LSRXUT.DLL access' call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs Say 'LoadLsRxutFuncs is complete.' version = LsRxutVer() say 'Version is ' version call DropLsRxutFuncs exit 0 Example output Testing LSRXUT.DLL access LoadLsRxutFuncs is complete. Version is 2.00.00 ═══ 6. Using LSRXUT.DLL in Multiple Processes ═══ When using the 'DropLsRxutFuncs' function, other processes using the LSRXUT.DLL are no more able to use the functions provided by LSRXUT.DLL before another set of of the functions are executed: call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs If you are experiencing strange results, please be sure that you are not using the DropLsRxutFuncs function while other REXX cmd files are still being executed. In multiple processing scenarios register the LSRXUT.DLL functions once. You can even execute the loading of LSRXUT.DLL from any starting procedure on your system, and then use the functions from any other REXX procedure file afterwords. Use the 'RxFuncQuery()' to validate the presence of the LSRXUT.DLL funcions once in the start of your procedures. If the function you intend to use is absent, register all LSRXUT.DLL functions only once. For example: /* Part of REXX proecedure to Control a printer device */ if RxFuncQuery('RxSplControlDevice') <> 0 then do call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs end In the above example we want to check whether the 'RxSplControlDevice()' function is registered. If not, we register all LSRXUT.DLL functions by using the two function calls in the 'if-then' block. We use the same technique in WatCom Visual REXX or VisPro/REXX to register the LSRXUT.DLL functions only once if they are not present. We prefer never to use the 'DropLsRxutFuncs' function. If you have memory constrants on the system you are running, you can use the 'DropLsRxutFuncs' function to release memory. ═══ 7. The Base Functions ═══ The LSRXUT.DLL contains a set of work related functions that where written during a redbook residency in Austin Texas. These functions are still included, but avoid using them. They do for most cases not handle the presence of multible domains correctly. The base functions are: GetDCName() Get the domain controller name CopyDirAcls() Copy directory access control profiles specified in the source location to the destination location. The source directory will be created if it does not exist. Local support only DumpAllUsers() Dump information about all userids to a binary file DumpUser() Dump information about a specified userid to a binary file InsertAllUsers() From a dump file re-establish all userid definitions. A new password must be supplied for each userid QueryDirAliasPath() Query the path of a directory alias MoveDirAlias() Redefine a directory alias and specify a new directory path SetLogonAsn() Set logon assignments for a userid GetLogonAsn() Get logon assignments for a userid NetEnum() Enumerate some of the LAN Server provided information GetLogonAsnAcp() Get logon assignments access control profiles ═══ 7.1. GetDCName() ═══ This function retrieves the Domain Controller Computer name. To function correctly, the administrator must be logged on to one domain only and not have any value specified in the othdomains = parameter in IBMLAN.INI. It is recommended to use the function NetEnumerate(NETSERVER) as a replacement. Syntax parse value GetDCName() with MyRc dcName Parameters The parameters returned are: MyRc The return code from the operation dcName The Domain Controller Computer name Note The function is only capable of returning one computer name. Example /* Get the DC computer name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs parse value GetDCName() with MyRc dcName if MyRc <> '0' then do say 'Could not obtain Domain Controller name' exit 9 end if dcName = '' then do say 'Could not obtain Domain Controller name' exit 9 end say 'Domain Controller Name is :' dcName call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Domain Controller Name is : \\ILIDC ═══ 7.2. CopyDirAcls() ═══ This function copies Directory Access Control Profiles specified in the source location to the destination location. The source directory will be created if it does not exist. Syntax MyRc = CopyDirAcls(srcDir, destDir) Parameters The parameters specified are: srcDir The path to the source directory, which must exist destDir The destination directory Note The function requires that the source directory path exists. Example /* Copy ACLs from source to destination */ parse arg srcDir destdir call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs say 'Source:' srcDir say 'Destination:' destDir MyRc = CopyDirAcls( srcDir, destDir ) say 'Returncode from CopyDirAcls(srcDir, destDir):' MyRc call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Source: D:\APPS\BOOKS Destination: F:\APPS\BOOKS Returncode from CopyDirAcls(srcDir, destDir): 0 ═══ 7.3. DumpAllUsers() ═══ This function copies all Userid definitions to a binary file. If the file is a valid "userid binary file" (a file created by the functions provided in LSRXUT.DLL), additional users can be appended to the file. Syntax MyRc = DumpAllUsers(dcName, dumpFile) Parameters The parameters specified are: dcName The computer name of the domain controller dumpFile The file name of the resulting binary file containing userid definitions Note The function copies userid definitions only into a binary file. The resulting binary file is intended to be used together with the InserAllUsers() function. Example /* Dump userid definitions to a binary file for safekeeping */ parse upper arg dumpFile if dumpFile = '' then dumpFile = 'C:\USERDEFS.BIN' dcName = '\\ILIDC' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs McRc = DumpAllUsers(dcName, dumpFile) say 'DumpAllUsers() returned:' MyRc call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output DumpAllUsers() returned: 0 ═══ 7.4. DumpUser() ═══ Dump a userid specified to a binary file. If the file is a valid "userid binary file" (a file created by the functions provided in LSRXUT.DLL), additional users can be appended to the file. This function copies a Userid definition to a binary file. The function is similar to the function DumpAllUsers(). Syntax MyRc = DumpUser(dcName, dumpFile, userId) Parameters The parameters specified are: dcName The computer name of the domain controller dumpFile The file name of the resulting binary file containing userid definitions userId The userid definition to dump into the binary file Note The function copies userid definitions only into a binary file. The resulting binary file is intended to be used together with the InserAllUsers() function. Example /* Dump a userid definition to a binary file for safekeeping */ parse upper arg dumpFile if dumpFile = '' then dumpFile = 'C:\USERDEFS.BIN' dcName = '\\ILIDC' userId = 'WS2221' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs MyRc = DumpUser(dcName, dumpFile, userId) say 'DumpUser() returned:' MyRc call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output DumpUser() returned: 0 ═══ 7.5. InsertAllUsers() ═══ From a binary userid dump file re-establish all userid definitions. A new password must be supplied. If one or more additional server ids are included in the dump file, but currently not defined, the resyncronisation of servers must be performed. The input binary userid dump file is created by the functions DumpAllUsers() or DumpUser(). Syntax MyRc = InsertAllUsers(dcName, dumpfile, logfile, newpassword) Parameters The parameters specified are: dcName The computer name of the domain controller dumpFile The file name of the resulting binary file containing userid definitions logfile A file containing log information newpassword A new password must be supplied. Note The function copies userid definitions from a binary file back to the domain. Use the log file created by this function to verify the success of the operation. Example /* Insert userid defintions from a binary dump file */ dcName = '\\ILIDC' dumpfile = 'C:\USERDEFS.BIN' logfile = 'C:\USERDEFS.LOG' newpassword = 'NEWPW' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs MyRc = InsertAllUsers(dcName, dumpfile, logfile, newpassword) say 'InsertAllUsers() returned:' MyRc call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output InsertAllUsers() returned:' 0 The log file contains for the insertion of the userids WS222B and WS222C. Userid WS222B successfully added. Userid WS222C already exists. No modification performed. End of binary userid dump file reached ═══ 7.6. QueryDirAliasPath() ═══ This function returns the path of a directory alias. The function is a limited subset of NetGetInfo(NETALIAS) which should be used instead. Syntax parse value QueryDirAliasPath(dcName, aliasName) with MyRc aliasPath Parameters The parameters specified are: dcName The computer name of the domain controller, which contains the alias definitions aliasName The directory alias name aliasPath The directory path returned if MyRc return code is 0. Note The function works only on directory alias definitions and the server name specified must be the domain controller computer name. Example /* Retrieve the directory path for a alias. */ dcName = '\\ILIDC' aliasName = 'BOOKS' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs parse value QueryDirAliasPath(dcName, aliasName) with MyRc aliasPath if MyRc = 0 then do say 'Alias' aliasName 'has the path' say aliasPath end else do say 'QueryDirAliasPath(dcName, aliasName) returned errorcode' MyRc end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Alias BOOKS has the path D:\APPS\BOOKS ═══ 7.7. MoveDirAlias() ═══ This function changes the directory definition of a directory alias. It does not move files and access control profiles. Syntax MyRc = MoveDirAlias(dcName, aliasName, serverName, newAliasDir) Parameters The parameters specified are: dcName The computer name of the domain controller, which contains the alias definition aliasName The directory alias name serverName The server name on which the new directory is located netAliasDir The new alias directory path Note The function works only on directory alias definitions. The new directory must exist. Example /* Change the directory path for an alias. */ dcName = '\\ILIDC' aliasName = 'ALLFILES' serverName = '\\ILIDC' newAliasDir = 'D:\SHARED\FILES' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs MyRc = MoveDirAlias(dcName, aliasName, serverName, newAliasDir) if MyRc \= 0 then do say 'MoveDirAlias returned with error code' MyRc end else do say 'Changed alias directory definition successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Changed alias directory definition successfully ═══ 7.8. SetLogonAsn() ═══ This function sets logon assignment for a userid. To function correctly, the administrator must be logged on to one domain only and not have any value specified in the othdomains = parameter in IBMLAN.INI. It is recommended to use the functions described in NetAdd(NETAPPSEL) and NetAdd(NETLOGONASN) as a replacement. Syntax MyRc = SetLogonAsn(userid, asnType, device, alias) Parameters The parameters specified are: userid The userid asnType The assignment type. The accepted values are: asnType What ------- ---- 'A=' Public application assignment 'D=' Device assignment, such as G:, COM5, LPT3 or none For a device assignment type a parameter value of '' can be specified device The device specification. This value can either be a drive, a com port or a printer port. An empty value can also be specified. This parameter value is ignored for Public application assignments alias The alias name for devices otherwise the name of the public application Note The function works only on a single domain. The function will fail if the administrator has a value specified in the othdomains = parameter in IBMLAN.INI or logged on to another domain. Example /* Add device and application logon assignments */ userid = 'WS222B' device = 'X:' alias = 'ALLFILES' /* Get access to LSRXUT.DLL functions */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs MyRc = SetLogonAsn(userid, 'D=', device, alias) if MyRc <> '0' then do say 'SetLogonAsn() returned ' MyRc end else do say 'Successfully performed Logon Assignment' end applName = 'BOOKMST' MyRc = SetLogonAsn(userid, 'A=', '', applname) if MyRc <> '0' then do say 'SetLogonAsn() returned ' MyRc end else do say 'Successfully performed Public Application Assignment' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Successfully performed Logon Assignment Successfully performed Public Application Assignment ═══ 7.9. GetLogonAsn() ═══ This function returns the logon assignments for a userid. To function correctly, the administrator must be logged on one domain only and not have any value specified in the othdomains = parameter in IBMLAN.INI. It is recommended to use the functions described in NetGetInfo(NETAPPSEL) and NetGetInfo(NETLOGONASN) as a replacement. Syntax MyRc = GetLogonAsn(userid, 'asnList') Parameters The parameters specified and returned are: userid The userid asnList.0 The number of logon assignment found. It has a value of '-none-' if no assignments are found asnList.i The returned assignment list. i has a value from 1 to asnList.0 The returned values are divided into two classes. For a device: type device alias For example: D= X: ALLFILES For an public application the following values are returned: type applicationName For example: A= BOOKMST Note The function works only on a single domain. The function will fail if the administrator has a value specified in the othdomains = parameter in IBMLAN.INI. Example /* List device and application assignment for a userid */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs userId = 'WS222B' MyRc = GetLogonAsn(userId, 'asnList') if MyRc = '0' then do say 'userid=' userId if asnList <> '-none-' then do do i=1 to asnList.0 say asnList.i end end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output A= BOOKMST D= X ALLFILES ═══ 7.10. NetEnum() ═══ The functions provided are replaced with the NetEnumerate() function. ═══ 7.11. GetLogonAsnAcp() ═══ This function returns the logon assignment access control profiles. To function correctly, the administrator must be logged on one domain only and not have any value specified in the othdomains = parameter in IBMLAN.INI. Syntax MyRc = GetLogonAsnAcp(userid, asnType, acpList) Parameters The parameters specified and returned are: userid The userid asnType The logon assignment type. Use: 'D=' for device type logon assignment 'A=' for public application type assignment 'ALL' for both device and public application type assignments acpList.0 The number of logon assignments found. It has a value of '-none-' if no assignments are found acpList.i The returned assignment list. i has a value from 1 to acpList.0 The returned values are divided into: type name access For example: D= ALLDILES RWC See for example NetGetInfo(NETACCESS) for more information about the access values. The returned values contains a list of all referenced alias used by an public application. Multiple entries for one public application may therefore occur. Note The function works only on a single domain. The function will fail if the administrator has a value specified in the othdomains = parameter in IBMLAN.INI. Example /* List device and application assignment ACP a userid */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs userId = 'WS222B' MyRc = GetLogonAsnAcp(userId, 'ALL', acpList) if MyRc = '0' then do say 'userid=' userId if acpList <> '-none-' then do do i=1 to acpList.0 say acpList.i end end end else do say 'GetLogonAsnAcp() failed with return code' MyRc end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output userid= WS222B A= BOOKS RWCXD A= BOOKMST No working directory specified D= ALLFILES RX ═══ 8. Handling Error Codes ═══ The REXX procedures using the IBM LAN Server utility DLL do return error codes from time to time. The return codes are either documented in the IBM OS/2 Programming Tools and Information (Toolkit) or the IBM LAN Server Application Programming Interface documentation. Another and very good way to understand the meaning of the return codes, is the OS/2 help facility. If you for example have a return code 3, what does is say? Try for example the following: HELP NET0003 does not exist but HELP SYS0003 does Another example. If you have the return code 2138, then information retrieved from the OS/2 help facility is: HELP NET2138 requester not started HELP SYS2138 requester not started ═══ 9. NetAdd ═══ The Net Add functions are a family of functions that can be called with a number of parameters. The NetAdd function has minimum two different parameters. The generic syntax is: MyRc = NetAdd(option, 'stemvar', parm1, parm2, parm3) MyRc = NetAdd(option, parm1, parm2, parm3) The option parameter contains a value to determine what type or option has to be added. An example would be the addition of a user account. The parm1, parm2, parm3 parameters are dependent on the performed option. The MyRc parameter is the return code that will have an value from the NetAdd() function. If the call is successful the character '0' will be returned. Otherwise an error code and descriptive text are inserted by the NetAdd() function. The option parameter values are defined in Option parameter values. ═══ 9.1. NETACCESS Add ═══ The function creates the auditing entry for a resource and adds 0 or more entries in the access control list for a resource. Syntax MyRc = NetAdd(NETACCESS, 'Access', SrvName, resourceName) Parameters The parameters required are: 'Access' The REXX variable holding the values. The variable is divided into: Access.count The number of access controls available for the resource. The value can be 0 or undefined. In this case access control profiles are not created Access.audit The auditing flags. If the variable is undefined a default value of No auditing is used. The flags are defined as: - A Audit all. When this bit is set, all access attempts will be audited - O If O, audit successful file opens - W If W, audit successful file writes and successful directory creates - D If D, audit successful file deletes or truncates and successful directory deletes - P If P, audit successful file and directory access control profile change - o If o, audit failed file opens - w If w, audit failed file writes and failed directory creates - d If d, audit failed file deletes or truncates and failed directory deletes - p If d, audit failed file and directory access control profile change - N or -none- No auditing is performed Access.i.ugname The user account or group name. i is a value from 1 to Access.count Use the group name USERS to create an access control profile for all users Access.i.access The access profile. i is specified as above. The access control flags are as follows: - N None - R Read - A Attribute - W Write - C Create - X Execute - D Delete - P Permissions - G This is a Group permission. The G parameter is not required to be specified SrvName The server computer name resourceName The resource name must be specified in the name format as described below: Resource Type Name Format ------------- ----------- Drive drive: Path \path Directory drive:pathname File drive:pathname UNC \\server\sharename\path Pipe \pipe\pipename Spooler Queue \print\queuename Serial Device Queue \comm\chardevqueue Note The server computer name can be specified as '' for a local server. Example /* Create a access control profile for a resource */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESS = 10 SrvName = '\\ILIDC' resourceName = 'D:\APPS\TEMP' Access.audit = 'A' Access.count = 2 Access.1.ugname = 'CSUSERS' Access.1.access = 'RX' Access.2.ugname = 'FMAM' Access.2.access = 'RWCXDP' myRc = NetAdd(NETACCESS, 'Access', SrvName, resourceName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say 'Access Control Profile created successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Access Control Profile created successfully ═══ 9.2. NETACCESSADD ═══ The function adds one or more access control profiles to a existing access control list for a resource. Syntax MyRc = NetAdd(NETACCESSADD, 'AddtoACL', SrvName, resourceName) Parameters The parameters required are: 'AddtoACL' The REXX variable holding the values. The variable is divided into: AddtoACL.count The number of access controls available for the resource. The value can be 0 or undefined. In this case access control profiles are not created AddtoACL.i.ugname The user account or group name. The variable i has a value from 1 to AddtoACL.count AddtoACL.i.access The access profile. The variable i is specified as above. The access control flags are as follows: - N None - A Attribute - R Read - W Write - C Create - X Execute - D Delete - P Permissions - G This is a Group permission. The G parameter is not required to be specified SrvName The server computer name resourceName The resource name must be specified in the name format as described below: Resource Type Name Format ------------- ----------- Drive drive: Path \path Directory drive:pathname File drive:pathname UNC \\server\sharename\path Pipe \pipe\pipename Spooler Queue \print\queuename Serial Device Queue \comm\chardevqueue Note The server computer name can be specified as '' for a local server. Example /* Add another Access Control Entry to existing Access Profile List */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESSADD = 250 SrvName = '\\ILIDC' resourceName = 'D:\APPS\TEMP' AddtoACL.count = 1 AddtoACL.1.ugname = 'CSUSERS' AddtoACL.1.access = 'RWC' myRc = NetAdd(NETACCESSADD, 'AddtoACL', SrvName, resourceName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Additional Access Control Profile added successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Additional Access Control Profile added successfully ═══ 9.3. NETALIAS Add ═══ The function creates an alias definition for a resource. Syntax MyRc = NetAdd(NETALIAS, 'AliasInfo', SrvName) Parameters The parameters required are: 'AliasInfo' The REXX variable holding the alias information values. The variable is divided into: AliasInfo.name The alias name AliasInfo.remark The alias remark AliasInfo.server The computer name of the server where the resource described by this alias resides. The server computer name can be different from the SrvName parameter AliasInfo.netname The alias name for files aliases, and the queue name for printer and serial device aliases. This value is not used by the NetAdd() function AliasInfo.location The alias location. The following values are valid: Location Location value -------- -------------- Within the domain 'Within Domain' 'INTERNAL' External, for DOS 'External, for DOS' 'EXTERNAL_DOS' External, for OS/2 'External, for OS/2' 'EXTERNAL_OS2' External, for DOS and OS/2 'External, for DOS and OS/2' 'EXTERNAL_BOTH' The default value is 'Within Domain' AliasInfo.mode When the alias is shared. The following values are valid: Sharing mode Mode value ------------ ---------- At server startup 'At server startup' 'STARTUP' By administrator 'By administrator' 'BYADMIN' At Requester use 'At Requester use' 'DYNAMIC' The default value is 'At Requester use' AliasInfo.maxuses The maximum number of users who can have redirection to the resource identified by this alias. The default value is 65535 AliasInfo.type The alias type. The following values are valid: Type Type value ---- ---------- Files alias 'Files' Printer alias 'Printer' Serial alias 'Serial' AliasInfo.queue The queue name for serial or printer alias only AliasInfo.path The path for files alias only AliasInfo.priority The serial device priority. The value can be from 1 to 9. 1 is the highest priority. The value of 9 will be used as default if no value is specified AliasInfo.device_pool The serial device pool. LPT1 to LPT9 and COM1 to COM9 can be used. If specified the entries are separated by a space. For example 'COM1 COM4' 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 alias */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETALIAS = 20 SrvName = '\\ILIDC' AliasInfo.name = 'THEBOOK' AliasInfo.remark = 'Temporary alias' AliasInfo.server = '\\ILIDC' AliasInfo.location = 'Within Domain' AliasInfo.mode = 'At Requester use' AliasInfo.type = 'Files' AliasInfo.path = 'D:\APPS\TEMP' myRc = NetAdd(NETALIAS, 'AliasInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Alias added successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Alias added successfully ═══ 9.4. NETAPP Add ═══ The function creates a public or private application. Syntax MyRc = NetAdd(NETAPP, 'AppInfo', SrvName) MyRc = NetAdd(NETAPP, 'AppInfo', SrvName, UserId) Parameters The parameters required are: 'AppInfo' The REXX variable holding the application information. The variable is divided into: AppInfo.name The application name AppInfo.remark The application remark or description. A remark must be provided AppInfo.command The command that starts the application AppInfo.command_parms The application start parameters if required AppInfo.app_alias_or_drv The alias or drive where the application resides. It specifies a drive letter, followed by a colon (:), if the application resides on the user's local machine or it specifies an existing alias if the application resides on a server AppInfo.app_drive Applies to DOS public applications only. It is used to specify the drive that is current when the application runs. Valid letters are A through X. A value of * indicates that the system should choose a drive letter AppInfo.app_path_to_dir The remaining path to the application AppInfo.wrkdir_alias_or_drv Specifies the directory that is made current when the application runs. If the working directory is on the local machine, it specifies the drive, where the directory is located. If the working directory is remote, it specifies an existing alias where the directory is located AppInfo.wrkdir_drive Specifies the drive that the working directory is to be assigned to when the application is started. For OS/2 applications, this can be any letter D through Z. For DOS applications, this can be any letter A through X. A value of * indicates that the system should choose a drive when the application is started. AppInfo.wrkdir_path_to_dir The remaining path to the working directory AppInfo.prompt Prompt for parameters. The following values can be used: Prompt for parameters Value --------------------- ----- Yes 'Prompt user for parameters' 'Yes' No 'Do not prompt user for parameters' 'No' The default value is 'No'. AppInfo.interface The interface type. The values can be: Interface type Value -------------- ----- Presentation Manager 'Presentation Manager' 'PM' OS/2 Fullscreen 'Fullscreen' 'FS' OS/2 Windowed 'Windowed' 'WIN' The default value is 'Presentation Manager'. AppInfo.type The application type. The following values are used: Application type Value ---------------- ----- Public DOS 'Public DOS application' 'PUBLIC_DOS' Public OS/2 'Public OS/2 application' 'PUBLIC_OS2' Private OS/2 'Private OS/2 application' 'PRIVATE_OS2' The default value is 'Public OS/2 application'. AppInfo.res_count The number of application resource list entries that follows. A value of zero indicates that the application does not require any redirected devices when it runs. AppInfo.i.arl_alias The alias for the resource required by the application. The variable i must have a value from 1 to AppInfo.res_count AppInfo.i.arl_device The device assigned to the resource specified. If AppInfo.i.arl_alias specifies a files alias, AppInfo.i.arl_device must be a drive letter followed by a colon (:). Valid drive letters for OS/2 applications are D: through Z:. Valid drive letters for DOS applications are A: through X:. If AppInfo.i.arl_alias specifies a print alias, valid values are LPT1 through LPT9. If AppInfo.i.arl_alias specifies a serial device alias, valid values for AppInfo.i.arl_device are LPT1 through LPT9 and COM1 through COM9. Additionally, each application resource list entry must have a unique value for its AppInfo.i.arl_device field. For example, if AppInfo.i.arl_alias specifies a files alias, the drive letter specified in the AppInfo.i.arl_device field must be different from AppInfo.app_drive, AppInfo.wrkdir_drive, and any other AppInfo.i.arl_device fields for files aliases. The variable i must have a value from 1 to AppInfo.res_count SrvName The server computer name of the domain controller Application The application name UserId The name of the userid. The name of the userid must be specified for private applications Note The server computer name can be specified as '' for a local domain controller. Example /* Add a public application */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPP = 30 SrvName = '\\ILIDC' AppInfo.name = 'BOOKREAD' AppInfo.remark = 'Shared Bookmanager Read/2' AppInfo.command = 'BOOKMGR.EXE' AppInfo.command_parms = '' AppInfo.app_alias_or_drv = 'BOOKMGR' /* Bookmanager programs alias */ /* AppInfo.app_drive not used */ AppInfo.app_path_to_dir = '\' AppInfo.wrkdir_alias_or_drv = 'BOOKMGR' AppInfo.wrkdir_drive = 'R' /* Make R: the working dir */ AppInfo.wrkdir_path_to_dir = '\' /* Remaining path */ AppInfo.prompt = 'Do not prompt user for parameters' AppInfo.interface = 'Presentation Manager' AppInfo.type = 'Public OS/2 application' /* The additional resources */ AppInfo.res_count = 3 AppInfo.1.arl_alias = 'SHAREDLL' AppInfo.1.arl_device = 'Y:' AppInfo.2.arl_alias = 'THEBOOK' AppInfo.2.arl_device = 'Q:' AppInfo.3.arl_alias = 'PRINTIT' AppInfo.3.arl_device = 'LPT4' myRc = NetAdd(NETAPP, 'AppInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Application added successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Application added successfully ═══ 9.5. NETAPPSEL Add ═══ The function adds an application to the specified userid application list. Syntax MyRc = NetAdd(NETAPPSEL, DcName, ApplicationName, UserId, AppType) Parameters The parameters required are: DcName The Domain Controller computer name ApplicationName The name of the application UserId The userid AppType Application type. The following application types are supported: Application type Value ---------------- ----- Public DOS application 'Public DOS application' 'DOS_PUBLIC' Public OS/2 application 'Public OS/2 application' 'OS2_PUBLIC' Private OS/2 application 'Private OS/2 application' 'OS2_PRIVATE' The default value is 'Public OS/2 application'. Note The domain controller computer name can be specified as '' for a local domain controller. If the application already is in the list, the application will not be added. Example /* Add a application to userid application list */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPPSEL = 32 DcName = '\\ILIDC' ApplicationName = 'BOOKREAD' UserId = 'WS2221' AppType = 'Public OS/2 application' myRc = NetAdd(NETAPPSEL, DcName, ApplicationName, UserId, AppType) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Application added successfully to user application list" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Application added successfully to user application list ═══ 9.6. NETDASD Add (LS40) ═══ The function invokes the directory limit function, placing a limit on the amount of disk space that can be used within a directory tree. Before this function can be invoked, directory limits must be enabled on the 386-HPFS drive. (See the NetMisc(NETDASDCONTROL) function) Syntax MyRc = NetAdd(NETDASD, 'DASDInfo', SrvName) Parameters The parameters required and returned are: 'DASDInfo' The directory limits information variable, which is divided into: DASDInfo.resource_name The name of the directory to add directory limit on. The parameter is the directory name, beginning with the drive letter and ending without the backslash (\). The path specified can be on a redirected drive. In this case, the SrvName parameter must be '' DASDInfo.max The amount of disk space allotted to this directory by directory limits. Specified in KB, this field can be set from 1 to 67108863. Note however, that subsequent access to the directory specified is functionally limited to the smaller of the following: 1. Any directory limits restrictions on any parent directory 2. The total free space on the drive DASDInfo.flag A flag controlling the operations when a directory limit added The following values are valid: Value Meaning ----- ------- 0 Compares a newly specified limit to the amount of disk space already taken by the directory. If the directory tree size exceeds the new limit, NERR_MaxValidationFailed (2304) is returned 1 Sets the new limit regardless of the present size of the directory tree The default is 0 DASDInfo.thresh The initial alert threshold as a percentage of the total directory limit space allotted, with values ranging from 0 to 99. Zero specifies that no threshold alert is to be generated, and 99 specifies that an alert is generated when 99% of the allotted directory limit for this directory has been reached. Note that a minimum of 1KB of disk space must be allotted to a threshold; the value obtained by multiplying the DASDInfo.thresh decimal-point value (where 5% is equal to 0.05) by DASDInfo.max must be at least 1KB. This threshold setting generates only 1 alert when this boundary is crossed. Subsequent alerts (generated incrementally after this threshold has been reached but before the entire limit is reached) are specified according to the DASDInfo.delta parameter The default value is 0 DASDInfo.delta The increment in which alerts are to be generated after the DASDInfo.thresh threshold has been crossed, but before all of the allotted disk space has been used. This parameter also is specified as a percentage of the total allotted directory limit space and can range from 0 upward, as long as its value is less than 99 - DASDInfo.thresh. Note that a minimum of 1KB of disk space must be allotted to an increment; the value obtained by multiplying the DASDInfo.delta decimal-point value (where 5% is equal to 0.05) by DASDInfo.max must be at least 1KB SrvName The computer name of the server to perform the directory limit add operation on Note The server computer name can be specified as '' for a local server. Example /* Add DASD directory limits on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASD = 750 DASDInfo.resource_name = 'D:\APPS\DATA' DASDInfo.max = 512 DASDInfo.flag = 0 DASDInfo.thresh = 90 DASDInfo.delta = 5 SrvName = '\\DOMAIN_CONTRLR' myRc = NetAdd(NETDASD, 'DASDInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc exitRc = 9 end else do say 'Directory limit successfully added' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Directory limit successfully added ═══ 9.7. NETGROUP Add ═══ The function creates a group. Syntax MyRc = NetAdd(NETGROUP, 'groupInfo', SrvName) Parameters The parameters required are: 'groupInfo' The REXX variable holding the group information. The variable is divided into groupInfo.name The group name groupInfo.comment The group comment or description. A default comment will be provided if groupInfo.comment does not hold a value. SrvName The server computer name of the domain controller Note The server computer name can be specified as '' for a local domain controller. Example /* Create a new group with a comment */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUP = 70 SrvName = '\\ILIDC' groupInfo.name = 'CSUSERS' groupInfo.comment = 'The Client/Server users group' myRc = NetAdd(NETGROUP, 'groupInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Group created successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Group created successfully ═══ 9.8. NETGROUPUSERS Add ═══ The function adds a user account to a group. Syntax MyRc = NetAdd(NETGROUPUSERS, SrvName, GroupName, UserId) Parameters The parameters required are: SrvName The server computer name of the domain controller GroupName The group name UserId The name of the userid to add Note The server computer name can be specified as '' for a local domain controller. Example /* Add a userid to a group */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUPUSERS = 340 SrvName = '\\ILIDC' GroupName = 'CS2USERS' UserId = 'WS2332' myRc = NetAdd(NETGROUPUSERS, SrvName, GroupName, UserId) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Userid added to Group successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Userid added to Group successfully ═══ 9.9. NETLOGONASN Add ═══ The function adds a logon assignment for a userid. Syntax MyRc = NetAdd(NETLOGONASN, DcName, aliasName, LocalName, UserId) Parameters The parameters required are: DcName The domain controller computer name aliasName The name of the alias to be assigned LocalName The device that will be assigned to the resource specified by aliasName when the user logs on. Valid drive letters are A through Z. The drive letter can be followed by a colon (:), but a colon is not required. A value of * indicates that the system will choose the first available drive. Valid print devices are LPT1 through LPT9. Valid serial devices are LPT1 through LPT9 and COM1 through COM9. Print and serial devices should not be followed by a colon (that is, COM1: is considered to be an invalid serial device). If the device field is left blank, the connection is to be deviceless. UserId The name of the userid Note The domain controller computer name can be specified as '' for a local domain controller. If the logon assignment already is in the list, the additional assignment will not be added. Example /* Add a logon assignment for a userid */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETLOGONASN = 52 DcName = '\\ILIDC' aliasName = 'BOOKS' LocalName = 'W' UserId = 'WS2221' myRc = NetAdd(NETLOGONASN, DcName, aliasName, LocalName, UserId) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Logon assignment added successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Logon assignment added successfully ═══ 9.10. NETMESSAGENAME Add ═══ The function registers a name in the message name table. Syntax MyRc = NetAdd(NETMESSAGENAME, msgName, fwdAction, SrvName) Parameters The parameters required are: msgName The message name to add into the name table fwdAction The action to take if name already is forwarded. If the value is not 0, the name is added to the message name table; if the value is 0, and the name has been forwarded already, an error is returned The default value is 0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or workstation. Example /* Add a message name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAME = 80 msgName = 'MSGNAME' fwdAction = 0 SrvName = '\\ANYSRV01' myRc = NetAdd(NETMESSAGENAME, msgName, fwdAction, SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc exitRc = 9 end else do say 'Message name entry added successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message name entry added successfully ═══ 9.11. NETSHARE Add ═══ The function adds a server share using either a alias or a shareInfo structure. Syntax MyRc = NetAdd(NETSHARE, 'shareInfo', SrvName) MyRc = NetAdd(NETSHARE, DcName, aliasName, NetName) Parameters The parameters required are: 'shareInfo' The REXX variable holding the share information. The variable is divided into: shareInfo.netname The netname of a resource. It is recommended that the shareInfo.netname and the shareInfo.path be the same for a Spooler Queue; otherwise, the result is unpredictable shareInfo.type The share type. The following values are used: Share type Value ---------- ----- Disk drive 'Disk Drive' 'DISKTREE' Spooler queue 'Spooler Queue' 'PRINTQ' Serial device 'Serial Device' 'DEVICE' Interprocess Communications 'Interprocess communication (IPC)' 'IPC' shareInfo.remark The share remark shareInfo.max_uses The maximum number of concurrent connections that the shared resource can accommodate. The default value is 65535 shareInfo.path The string containing the local path name of the shared resource. For disks, shareInfo.path is the path being shared. For spooler queues, shareInfo.path is the name of the spooler queue being shared. For serial device queues, shareInfo.path is a string of one or more communication device names separated by spaces (for example, COM1 COM2 COM6). It is recommended that the shareInfo.netname and the shareInfo.path be the same for a Spooler Queue; otherwise, the result is unpredictable SrvName The computer name of the server that has the resource to be shared The second form of the function call is divided into: DcName The domain controller computer name, which holds the alias information aliasName The alias name NetName The share network name. For a spooler queue the Queue name will be identical with the netname. It the value is empty, the default Alias netname will be used. It is recommended to use the same netname as the alias name Note The server and DcName computer names can be specified as '' for a local server. Example using shareInfo structure /* Net share add using a net share info structure */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 SrvName = '\\ILIDC' shareInfo.netname = 'TEMP' shareInfo.type = 'Disk Drive' shareInfo.remark = 'Temporary files share' shareInfo.max_uses = 10 shareInfo.path = 'D:\TEMP\FILES' myRc = NetAdd(NETSHARE, 'shareInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Resource shared successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Resource shared successfully Example using an alias /* Net share add using an alias */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 DcName = '\\ILIDC' aliasName = 'THEBOOK' NetName = 'THEBOOK' myRc = NetAdd(NETSHARE, DcName, aliasName, NetName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Resource shared successfully" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Resource shared successfully ═══ 9.12. NETUSE Add ═══ The function adds a use to a resource using either a UNC name or an alias. Syntax MyRc = NetAdd(NETUSE, 'useInfo', ComputerName) MyRc = NetAdd(NETUSE, DcName, aliasName, LocalName, ComputerName) Parameters The parameters required are: 'useInfo' The REXX variable holding the use information. The variable is divided into: useInfo.local The local device name being redirected to the shared resource. The variable can either be a device name connection or a UNC connection. The following format can be used: Connection type Format --------------- ------ Device Name D: to Z: LPT1: to LPT9: COM1: to COM9: UNC '' For UNC connections the remote parameter will be used to specify the resource to be used useInfo.remote The UNC name of the remote resource being accessed. The following UNC syntax must be used: \\servername\sharename The sharename is identical to the netname useInfo.password This password if required. A value of 'N/A' or '' will be used as no password required. If the variable does not exist the default default value is no password required useInfo.asg_type The resource type. The following values must be used: Device type Value ----------- ------ Disk Device 'Disk device' 'DISKDEV' Spooled device 'Spooled printer' 'SPOOLDEV' Serial device 'Serial device' 'CHARDEV' Interprocess communication (IPC) 'Interprocess communication (IPC)' 'IPC' UNC where local is '' 'UNC' ComputerName The name of the computer that performs the net use operation. For a local workstation the value can be ''. The second form requires that the resource specified by the alias already is shared, otherwise a return code 67 will be returned. The second form of the function call is divided into: DcName The domain controller computer name, which holds the alias information aliasName The alias name LocalName The local device name being redirected to the shared resource. The variable can either be a device name connection or a UNC connection. The following format can be used: Connection type Format --------------- ------ Device Name D: to Z: LPT1: to LPT9: COM1: to COM9: UNC '' For UNC connections the remote resource name will be created from the alias ComputerName The name of the computer that performs the net use operation. For a local workstation the value can be ''. Note The ComputerName and DcName can be specified as '' for a local server A example using the useInfo structure /* Net use add using a net use info structure */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 ComputerName = '\\ILIDC' useInfo.local = 'W:' useInfo.remote = '\\ILIDC\BOOKS' useInfo.password = '' useInfo.asg_type = 'Disk device' myRc = NetAdd(NETUSE, 'useInfo', ComputerName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Successfully using resource" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Successfully using resource A example using an alias as parameter /* Net use add using an alias */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 DcName = '\\ILIDC' aliasName = 'BOOKMGR' LocalName = 'X:' ComputerName = '\\ILIDC' myRc = NetAdd(NETUSE, DcName, aliasName, LocalName, ComputerName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say "Successfully using resource" end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Successfully using resource ═══ 9.13. 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: userInfo.name The userid account name userInfo.password The userid account password userInfo.priv The userid account privilege level. The following values can be used: Account type Value ------------ ----- Guest 'Guest' User 'User' Administrator 'Admin' 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. 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 ═══ 9.14. 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: userInfo.name The userid account name userInfo.password The userid account password userInfo.priv The userid account privilege level. The following values can be used: Account type Value ------------ ----- Guest 'Guest' User 'User' Administrator 'Administrator' 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. userInfo.comment The user account comment 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 ----- ------- 1 Must be 1. Logon script enabled 2 If 1, user account disabled 4 If 1, user account cannot be deleted 8 If 1, home directory required 32 If 1, password not required 64 If 1, user cannot change password You can combine flags by adding the values 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 ----- ------- 1 Print operator privilege is enabled 2 Comm operator privilege is enabled 4 Server operator privilege is enabled 8 Accounts operator privilege is enabled You can combine operator privileges by adding the values userInfo.full_name The full name of the user account userInfo.usr_comment A string that is a user settable field userInfo.script_path The name of the logon script together with the path specification relative to the NETLOGON SCRIPT parameter 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" 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 = 1 userInfo.auth_flags = 3 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 ═══ 9.15. NETUSERINITDCDB Add ═══ The function creates a new userid entry and forces the creation of the \IBMLAN\DCDB\USERS\userid directory on the Domain Controller. The function is otherwise identical to NetAdd(NETUSER). Syntax MyRc = NetAdd(NETUSERINITDCDB, 'userInfo', SrvName) Example /* Add a userid and make DCDBInit request */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERINITDCDB = 290 SrvName = '\\ILIDC' userInfo.name = 'WST1' userInfo.password = 'PASSWORD' userInfo.priv = 'User' userInfo.home_dir = '' userInfo.comment = 'Workstation with DCDB directory' myRc = NetAdd(NETUSERINITDCDB, 'userInfo', SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc call DropLsRxutFuncs exit 9 end else do say say 'Userid successfully added' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Userid successfully added ═══ 10. NetDelete ═══ The Net delete functions are a family of functions that can be called with a number of parameters. The use of the NetDelete has a minimum of two different parameters. The generic syntax is: MyRc = NetDelete(option, parm1, parm2, parm3) The option parameter contains a value to determine what type or option has to be deleted. An example would be the deletion of a user account. The parm1, parm2, parm3 parameters are dependent on the performed option. The MyRc parameter is the return code that will have an value from the NetDelete() function. If the call is successful the character '0' will be returned. Otherwise an error code and descriptive text are inserted by NetDelete() function. The option parameter values are defined in Option parameter values. ═══ 10.1. NETACCESS Delete ═══ The function deletes all access permission records for a particular shared resource. Syntax MyRc = NetDelete(NETACCESS, SrvName, Path) Parameters The parameters specified are: SrvName The server computer name Path The path. This variable must have a value. See below: Resource Type Basepath Format ------------- --------------- Drive drive: Path \path Directory drive:pathname File drive:pathname UNC \\server\sharename\path Pipe \pipe\pipename Spooler Queue \print\queuename Serial Device Queue \comm\chardevqueue Note The server computer name can be specified as '' for a local server. Example /* Delete access control profile */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESS = 10 SrvName = '\\ILIDC' Path = 'D:\TEMP' myRc = NetDelete(NETACCESS, SrvName, Path) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Access Control Profile deleted' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Access Control Profile deleted ═══ 10.2. NETACCESSDEL ═══ The function deletes one access permission record for a particular existing access control profile. Syntax MyRc = NetDelete(NETACCESSDEL, SrvName, resourceName, ugName) Parameters The parameters specified are: SrvName The server computer name resourceName The name of the resource. This variable must have a value. See below for accepted values: Resource Type Basepath Format ------------- --------------- Drive drive: Path \path Directory drive:pathname File drive:pathname UNC \\server\sharename\path Pipe \pipe\pipename Spooler Queue \print\queuename Serial Device Queue \comm\chardevqueue ugName The user or group name Note The server computer name can be specified as '' for a local server. Example /* Delete access control profile entry */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESSDEL = 240 SrvName = '\\ILIDC' resourceName = 'D:\APPS\TEMP' ugName = 'CSUSERS' myRc = NetDelete(NETACCESSDEL, SrvName, resourceName, ugName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Access Control Profile Entry deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Access Control Profile Entry deleted successfully ═══ 10.3. NETALIAS Delete ═══ The function deletes an alias definition. Syntax MyRc = NetDelete(NETALIAS, SrvName, AliasName) Parameters The parameters specified are: SrvName The server computer name AliasName The alias name Note The server computer name can be specified as '' for a local server. Example /* Delete alias definition */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETALIAS = 20 SrvName = '\\ILIDC' AliasName = 'THEALIAS' myRc = NetDelete(NETALIAS, SrvName, AliasName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Alias deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Alias deleted successfully ═══ 10.4. NETAPP Delete ═══ The function deletes a public or private application definition. Syntax MyRc = NetDelete(NETAPP, SrvName, PublicApp) MyRc = NetDelete(NETAPP, SrvName, PrivateApp, UserId) Parameters The parameters specified are: SrvName The server computer name PublicApp Use the NetDelete() function with 3 arguments to delete a public application PrivateApp This is the name of a private application. It must be used together with a userid UserId The userid Note The server computer name can be specified as '' for a local server. Example /* Delete a public application definition */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPP = 30 SrvName = '\\ILIDC' PublicApp = 'MSAPP' myRc = NetDelete(NETAPP, SrvName, PublicApp) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Public application deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Public application deleted successfully ═══ 10.5. NETAPPSEL Delete ═══ The function removes an application from the specified userid application selector list. Syntax MyRc = NetDelete(NETAPPSEL, SrvName, UserId) MyRc = NetDelete(NETAPPSEL, SrvName, UserId, ApplicationName) Parameters The parameters specified are: SrvName The server computer name UserId The userid to be deleted ApplicationName The application name to remove from the application selection list. Using the function call without an application name removes all applications from the specified userid application selector list Note The server computer name can be specified as '' for a local server. Example /* Delete a application from user dekstop */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPPSEL = 32 SrvName = '\\ILIDC' UserId = 'WS12345' ApplicationName = 'LIVA' myRc = NetDelete(NETAPPSEL, SrvName, UserId, ApplicationName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Application removed from desktop successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Application removed from desktop successfully ═══ 10.6. NETDASD Delete (LS40) ═══ The function deletes a directory limit from a specified directory. Before this function can be invoked, directory limits must be enabled on the 386-HPFS drive. (See the NetMisc(NETDASDCONTROL) function) Syntax MyRc = NetDelete(NETDASD, SrvName, DirPath) Parameters The parameters specified are: SrvName The server computer name DirPath The path specification for the directory limit to delete Note The server computer name can be specified as '' for a local server. Example /* Delete a DASD directory limit on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASD = 750 DirPath = 'D:\APPS\DATA' SrvName = '\\DOMAIN_CONTRLR' myRc = NetDelete(NETDASD, DirPath, SrvName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc exitRc = 9 end else do say 'Directory limit successfully deleted' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc exit 0 Example Output Directory limit successfully deleted ═══ 10.7. NETFILECLOSE Close a fileid ═══ The function performs a close on an opened file. Syntax MyRc = NetDelete(NETFILECLOSE, SrvName, FileId) Parameters The parameters specified are: SrvName The server computer name on which the file is opened FileId The numeric file identifier of the file to be closed Note The server computer name can be specified as '' for a local server. Example /* Close an opened file on a server */ if RxFuncQuery('NetDelete') <> 0 then do call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs end NETFILECLOSE = 220 SrvName = '\\ILIDC' FileId = 3 myRc = NetDelete(NETFILECLOSE, SrvName, FileId) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc exit 9 end else do say 'File closed successfully' say end exit 0 Example Output File closed successfully ═══ 10.8. NETGROUP Delete ═══ The function deletes a group definition. Syntax MyRc = NetDelete(NETGROUP, SrvName, GroupName) Parameters The parameters specified are: SrvName The server computer name GroupName The name of the group definition to delete Note The server computer name can be specified as '' for a local server. Example /* Delete a group definition */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUP = 70 SrvName = '\\ILIDC' GroupName = 'TMPGROUP' myRc = NetDelete(NETGROUP, SrvName, GroupName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Group definition deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Group definition deleted successfully ═══ 10.9. NETGROUPUSERS Delete ═══ The function deletes a userid from a group definition. Syntax MyRc = NetDelete(NETGROUPUSERS, SrvName, GroupName, UserId) Parameters The parameters specified are: SrvName The server computer name GroupName The name of the group UserId The userid to delete from a group Note The server computer name can be specified as '' for a local server. Example /* Delete a group definition */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUPUSERS = 340 SrvName = '\\ILIDC' GroupName = 'THEGROUP' UserId = 'WS1000' myRc = NetDelete(NETGROUPUSERS, SrvName, GroupName, UserId) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Userid deleted from group successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Userid deleted from group successfully ═══ 10.10. NETLOGONASN Delete ═══ The function removes all or one resource from a userid logon assignment list. Syntax MyRc = NetDelete(NETLOGONASN, SrvName, UserId) MyRc = NetDelete(NETLOGONASN, SrvName, UserId, AliasName) Parameters The parameters specified are: SrvName The server computer name UserId The userid to be deleted AliasName The alias name which will be removed from the logon assignment list Use the function call with 3 parameters to delete all logon assignments for a userid. Use the function call with 4 parameters to delete a logon assignment for a known alias Note The server computer name can be specified as '' for a local server. Example /* Delete a logon assignment for a user */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETLOGONASN = 52 SrvName = '\\ILIDC' UserId = 'WS12345' Alias = 'BOOKS' myRc = NetDelete(NETLOGONASN, SrvName, UserId, Alias) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Logon Assignment removed successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Logon Assignment removed successfully ═══ 10.11. NETMESSAGENAME Delete ═══ The function deletes a name in the message name table. Syntax MyRc = NetDelete(NETMESSAGENAME, msgName, fwdAction, SrvName) Parameters The parameters required are: msgName The message name to delete from the name table fwdAction The action to take if the messages for name are forwarded to another name. If the value is nonzero, the forwarded name is deleted. If the value is 0, the name is not deleted. The default value is 0 SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* Delete a name from the message name table */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAME = 80 msgName = 'MSGNAME' fwdAction = 0 SrvName = '\\ANYSRV01' myRc = NetDelete(NETMESSAGENAME, msgName, fwdAction, SrvName) if myRc <> '0' then do say 'Got error from NetAdd() ' myRc exitRc = 9 end else do say 'Message name entry deleted successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message name entry deleted successfully ═══ 10.12. NETPRINTJOB Delete ═══ The function deletes a print job from a printer queue. Syntax MyRc = NetDelete(NETPRINTJOB, SrvName, QueueName, JobId) Parameters The parameters specified are: SrvName The server computer name QueueName The name of the printer queue JobId The job identification number Note The server computer name can be specified as '' for a local server. Example /* Delete a print job */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTJOB = 110 SrvName = '\\ILIDC' QueueName = 'IBM4019L' JobId = 6 myRc = NetDelete(NETPRINTJOB, SrvName, QueueName, JobId) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Print job deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Print job deleted successfully ═══ 10.13. NETSESSION Delete ═══ The function ends a session between a requester and a server. Syntax MyRc = NetDelete(NETSESSION, SrvName, RequesterName) Parameters The parameters specified are: SrvName The server computer name RequesterName The computer name of the requester that established the session being discontinued Note The server computer name can be specified as '' for a local server. Example /* Stop a session between a server and a requester */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSESSION = 180 SrvName = '\\ILIDC' RequesterName = '\\TEST19' myRc = NetDelete(NETSESSION, SrvName, RequesterName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Session stopped successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Session stopped successfully ═══ 10.14. NETSHARE Delete ═══ The function deletes a network name from the list of shared resources of a server. Syntax MyRc = NetDelete(NETSHARE, SrvName, NetName) Parameters The parameters specified are: SrvName The server computer name NetName The network name of the shared resource Note The server computer name can be specified as '' for a local server. Example /* Stop sharing a shared resource */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 SrvName = '\\ILIDC' NetName = 'BOOKS' myRc = NetDelete(NETSHARE, SrvName, NetName) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Share stopped successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Share stopped successfully ═══ 10.15. NETUSE Delete ═══ The function ends a connection between a local or UNC device name and a shared resource. Syntax MyRc = NetDelete(NETUSE, SrvName, DeviceName, Force) Parameters The parameters specified are: SrvName The server computer name DeviceName The device name that contains the following information: If the connection is a device name connection, the name specified must be the name of the local device If the connection is a UNC connection (either implicit or explicit), the name must be the UNC name Force Is one of three values specifying the type of disconnection. The following force values are available: 0 USE_NOFORCE Maintains the connection in a dormant state, decrementing the usecount. A dormant session can quickly be activated as soon as reconnection is needed, improving system performance 1 USE_FORCE Connection is removed only if no file, directory, or drive is opened. The usecount is decremented for a local device name connection and forced to 0 for a UNC connection 2 USE_LOTS_OF_FORCE All files, directories, and drives open on the connection are forced closed Note The server computer name can be specified as '' for a local server. Example /* Stop using a UNC name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 SrvName = '\\ILIDC' DeviceName = '\\ILIDC\BOOKS' Force = 1 myRc = NetDelete(NETUSE, SrvName, DeviceName, Force) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Net Use stopped successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Net Use stopped successfully ═══ 10.16. NETUSER Delete ═══ The function removes an user account from the user account subsystem database (UAS), ending all access to the resources in the system. Syntax MyRc = NetDelete(NETUSER, SrvName, UserId) Parameters The parameters specified are: SrvName The server computer name UserId The userid to be deleted Note The server computer name can be specified as '' for a local server. Example /* Delete a userid */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSER = 280 SrvName = '\\ILIDC' UserId = 'WS1000' myRc = NetDelete(NETUSER, SrvName, UserId) if myRc <> '0' then do say 'Got error from NetDelete() ' myRc call DropLsRxutFuncs exit 9 end else do say 'Userid deleted successfully' say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Userid deleted successfully ═══ 11. NetEnumerate ═══ The Net enumerate functions are a family of functions that can be called with a number of parameters. The NetEnumerate function has two to five different parameters. The generic syntax is: MyRc = NetEnumerate(option, 'StemVar', parm1, parm2, parm3) The option parameter contains a value to determine what type or option has to be enumerated. An example would be the enumeration of user accounts. The StemVar parameter is specified in quotes. It will actually contain the resulting information from the enumeration. The parm1, parm2, parm3 parameters are dependent on the performed option. The MyRc parameter is the return code that will have an value from the NetEnumerate() function. If the call is successful the character '0' will be returned. Otherwise an error code and descriptive text are inserted by NetEnumerate() function. The option parameter values are defined in Option parameter values. ═══ 11.1. NETACCESS Enumerate ═══ The function enumerates resource names having a access permission record (ACP, Access Control Profile). The number of returned entries will be either complete or incomplete. Syntax MyRc = NetEnumerate(NETACCESS, 'resourcesAcp', SrvName, BasePath) Parameters The parameters specified are: 'resourcesAcp' The REXX variable receiving the result. The variable is divided into: resourcesAcp.extend This variable indicates if the list provided is either 'Complete' or 'Incomplete'. A incomplete list of resources having a access control profile can be extended by calling the NetEnumerate with different base path values resourcesAcp.0 The number of resources having a access control profile. If no access control profiles where found, the value is 0 and the resourcesAcp.1 is equal to '-none-' resourcesAcp.i The resources having a access control profile. The variable i has a value from 1 to resourcesAcp.0. The resources listed are relative to the basepath specified SrvName The server computer name Basepath This variable can either be '' or have a path value. See below: Resource Type Basepath Format ------------- --------------- Directory drive:pathname File drive:pathname Pipe \pipe\pipename Spooler Queue \print\queuename Serial Device Queue \comm\chardevqueue Note The server computer name can be specified as '' for a local server. Example /* List resources having a access control profile */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESS = 10 SrvName = '\\DOMAIN_CONTRLR' BasePath = 'C:\IBMLAN' /* BasePath = '' */ myRc = NetEnumerate(NETACCESS, 'resourcesAcp', SrvName, BasePath) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if resourcesAcp.0 = 0 then do say '-none-' call DropLsRxutFuncs exit 0 end say 'The list provided is: ' resourcesAcp.extend say 'Number of resources having a access control profile: ' resourcesAcp.0 say say 'The base path is: ' BasePath say 'Resources listed are relative to the base path' say do i=1 to resourcesAcp.0 say resourcesAcp.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output The list provided is: Complete Number of resources having an access control profile: 19 The base path is: C:\IBMLAN Resources listed are relative to the base path \DOSLAN\DOS \DOSLAN\NET \DCDB \DCDB\DATA \DCDB\USERS\FMAM \BOOK \DCDB\APPS \DCDB\USERS\USERID\BATCH \DCDB\USERS\LINDBERG\BATCH \DCDB\USERS\FMAM\BATCH \DCDB\FILES \DCDB\LISTS \DCDB\IMAGES \DCDB\USERS\USERID \DCDB\DEVICES \NETPROG \REPL\IMPORT\SCRIPTS \DCDB\USERS\LINDBERG \DCDB\PRINTERS ═══ 11.2. NETALIAS Enumerate ═══ The function enumerates alias names of a given type. Syntax MyRc = NetEnumerate(NETALIAS, 'aliasNames', SrvName) MyRc = NetEnumerate(NETALIAS, 'aliasNames', SrvName, AliasType) Parameters The parameters specified are: 'aliasNames' The REXX variable receiving the result. The variable is divided into: aliasNames.0 The number of alias names returned aliasNames.i The alias name number i, where the variable i has a value from 1 to aliasNames.0. SrvName The server computer name AliasType The AliasType can be specified as indicated below: ALIAS_TYPE_FILE = 1 ALIAS_TYPE_PRINTER = 2 ALIAS_TYPE_SERIAL = 4 If AliasType is specified as '', it is identical as enumerate all alias names defined. This is identical as the call to NetEnumerate() without specifying a forth parameter Note The server computer name can be specified as '' for a local server. Example /* List all defined alias names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETALIAS = 20 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETALIAS, 'aliasNames', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if aliasNames.0 = 0 then do say '-none-' call DropLsRxutFuncs exit 0 end say 'Number of alias names: ' aliasNames.0 say do i=1 to aliasNames.0 say aliasNames.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of alias names: 3 BOOKS MYDEMO SRVCOM ═══ 11.3. NETAPP Enumerate ═══ The function returns the application names of a given type. Syntax MyRc = NetEnumerate(NETAPP, 'appNames', SrvName) MyRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId) MyRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId, AppType) Parameters The parameters specified are: 'appNames' The REXX variable receiving the result. The variable is divided into: appNames.0 The number of application names returned appNames.i The application name number i, where the variable i has a value from 1 to appNames.0. SrvName The server computer name of the domain controller UserId The Userid is specified for private application. For a list of all public DOS and OS/2 application use NetEnumerate(NETAPP) with 3 parameters. AppType Use this value together with the five parameter call til NetEnumerate() to control the application names returned. The values defined can be added to enumerate a combination of application types. Use a empty value for the UserId parameter to enumerate public applications. The following values are used: Value Enumerate ----- --------- 1 Public DOS applications 2 Public OS/2 applications 4 Private OS/2 applications 8 Private DOS applications MyRc The return code. You will get the return code 3 if the userid specified for the private applications does not have the domain controller database entries available. See also NETUSERINITDCDB Note The server computer name can be specified as '' for a local domain controller. Example /* List all public applications and private applications for FMAM */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPP = 30 SrvName = '\\DOMAIN_CONTRLR' UserId = 'FMAM' /* Get all public application names */ myRc = NetEnumerate(NETAPP, 'appNames', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if appNames.0 = 0 then do say 'No public applications defined' end else do say 'Number of public applications: ' appNames.0 say do i=1 to appNames.0 say appNames.i end say end /* Get all private application names for UserId */ myRc = NetEnumerate(NETAPP, 'appNames', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if appNames.0 = 0 then do say 'No private applications defined for ' UserId call DropLsRxutFuncs exit 0 end say 'Number of private applications for ' UserId 'is:' appNames.0 say do i=1 to appNames.0 say appNames.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of public applications: 3 ALLAPPS LANMSG THENEW No private applications defined for FMAM ═══ 11.4. NETBIOS Enumerate ═══ The function returns information on all network device drivers installed on a computer. Syntax MyRc = NetEnumerate(NETBIOS, 'netBiosInfo') MyRc = NetEnumerate(NETBIOS, 'netBiosInfo', SrvName) Parameters The parameters specified are: 'netBiosInfo' The REXX variable receiving the result. The variable is divided into: netBiosInfo.0 The number of netbios device drivers netBiosInfo.i The netbios device driver name entry i, where the variable i has a value from 1 to netBiosInfo.0 SrvName The requester or server computer name Note The server computer name can be specified as '' for a local computer There call to NetEnumerate with 2 parameters is identical to the call with 3 parameters where SrvName is set to ''. Example /* List NetBIOS device drivers names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETBIOS = 90 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETBIOS, 'netBiosInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if netBiosInfo.0 = 0 then do say 'No driver information' call DropLsRxutFuncs exit 0 end say 'Number of NetBIOS device drivers: ' netBiosInfo.0 say do i=1 to netBiosInfo.0 say netBiosInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of NetBIOS device drivers: 1 NETLB ═══ 11.5. NETCHARDEV Enumerate ═══ The function provides a list of serial devices on a server. Syntax MyRc = NetEnumerate(NETCHARDEV, 'charDevInfo', SrvName) Parameters The parameters specified are: 'charDevInfo' The REXX variable receiving the result. The variable is divided into: charDevInfo.0 The number of serial devices charDevInfo.i The serial device name entry i, where the variable i has a value from 1 to charDevInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or computer. Example /* List serial device names on a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCHARDEV = 130 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETCHARDEV, 'charDevInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if charDevInfo.0 = 0 then do say 'No serial devices defined on server' call DropLsRxutFuncs exit 0 end say 'Number of serial device names: ' charDevInfo.0 say do i=1 to charDevInfo.0 say charDevInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of serial device names: 1 COM1 ═══ 11.6. NETCHARDEVQ Enumerate ═══ The function provides a list of serial device queues on a server. Syntax MyRc = NetEnumerate(NETCHARDEVQ, 'charDevQInfo', SrvName) Parameters The parameters specified are: 'charDevQInfo' The REXX variable receiving the result. The variable is divided into: charDevQInfo.0 The number of serial device queues charDevQInfo.i The serial device queue name entry i, where the variable i has a value from 1 to charDevQInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or computer. Example /* List serial device queue names on a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCHARDEVQ = 140 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETCHARDEVQ, 'charDevQInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if charDevQInfo.0 = 0 then do say 'No serial device queues defined' call DropLsRxutFuncs exit 0 end say 'Number of serial device queue names: ' charDevQInfo.0 say do i=1 to charDevQInfo.0 say charDevQInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of serial device queue names: 1 SRVCOM ═══ 11.7. NETCONNECTION Enumerate ═══ The function returns a list of connections made to a shared resource of a server, or a list of all connections established from a particular computer to a server. This function is identical to NetGetInfo(NETCONNECTION). Syntax MyRc = NetEnumerate(NETCONNECTION, 'connInfo', SrvName, Qualifier) Parameters The parameters specified are: 'connInfo' The REXX variable receiving the result. The variable is divided into: connInfo.num_entries The number of connection information entries. Each entry is obtained by the index i, which has a value from 1 to connInfo.num_entries. The connInfo.0 has the same value available connInfo.i.id The connection id connInfo.i.type The type of connection made from the local device name to the shared resource connInfo.i.num_opens The number of files that are currently open as a result of the connection connInfo.i.num_users The number of users on the connection connInfo.i.time The number of seconds the connection has been established connInfo.i.username The name of the user that made the connection connInfo.i.netname A string indicating either the netname of the shared resource of the server or the computer name of the requester, depending on which name was specified as the Qualifier parameter SrvName The server computer name Qualifier A string specifying either the netname of the shared resource whose connections will be listed or the client name of the requester whose connections to the shared resource will be listed Note The server computer name can be specified as '' for a local server. Example /* Enumerate connection information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCONNECTION = 40 SrvName = '\\DOMAIN_CONTRLR' Qualifier = '\\ITSCWK21' myRc = NetEnumerate(NETCONNECTION, 'connInfo', SrvName, Qualifier) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if connInfo.0 = 0 then do say 'No connections established' call DropLsRxutFuncs exit 0 end if connInfo.num_entries <> 0 then do say "Number of entries: " connInfo.num_entries do i=1 to connInfo.num_entries say say "Connection id: " connInfo.i.id say "Connection type: " connInfo.i.type say "Connection num opens: " connInfo.i.num_opens say "Connection num users: " connInfo.i.num_users say "Connection time: " connInfo.i.time say "Connection user name: " connInfo.i.username say "Connection net name: " connInfo.i.netname end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 2 Connection id: 6145 Connection type: Interprocess Communication Connection Connection num opens: 0 Connection num users: 1 Connection time: 411 Connection user name: ADMIN04 Connection net name: IPC$ Connection id: 59393 Connection type: Disk Connection Connection num opens: 1 Connection num users: 1 Connection time: 367 Connection user name: ADMIN04 Connection net name: C$ ═══ 11.8. NETDASD Enumerate (LS40) ═══ The function returns a list of directories that have had directory limits applied to them. Before this function can be used successfully, directory limits must be enabled on the 386-HPFS drive. (See the NetMisc(NETDASDCONTROL) function) Syntax MyRc = NetEnumerate(NETDASD, 'DASDInfo', SrvName) Parameters The parameters required and returned are: 'DASDInfo' The directory limits information variable, which is divided into: DASDInfo.DirPath A string containing the directory path to be enumerated The string must be directory path, beginning with the drive letter, and only ending with a backslash when a root directory is specified. If DASDInfo.DirPath is set to '', the function returns all root directories and subdirectories with directory limits for each logical 386-HPFS drive. If a redirected drive is specified for DASDInfo.DirPath, the SrvName parameter must be '' DASDInfo.BufferSize This is a internal workbuffer to hold the directory limits. It is used to limit the amount of returned directory limits DASDInfo.recursive A varaible controlling recursive enumeration. The values are: Value Meaning ----- ------- 0 Return directory limit for the directory specified only 1 Return all directory limits for the directory specified and all subdirectories The default value is 0 DASDInfo.count The number of directory limits returned. The variable i has a value from 1 to DASDInfo.count for the following parameters DASDInfo.EntriesAvail This is a parameter returned to indicate if there where more data available with the Buffer Size specified If the value is larger then DASDInfo.count then more data than BufferSize was available. Otherwise the BufferSize was sufficient for to hold all directory limits retrieved DASDInfo.i.resource_name The relative name of the directory having a directory limit. For the base path itself, the value '' is returned. The folowing directory entries are all relative to the base path (DASDInfo.DirPath) DASDInfo.i.max The amount of disk space allotted to this directory by directory eimits. Specified in KB, this field can be set from 1 to 67108863. DASDInfo.i.use The amount (in KB) of disk space already occupied within the specified directory resource DASDInfo.i.thresh The initial alert threshold as a percentage of the total directory limit space allotted, with values ranging from 0 to 99. Zero specifies that no threshold alert is to be generated, and 99 specifies that an alert is generated when 99% of the allotted directory limit for this directory has been reached. DASDInfo.i.delta The increment in which alerts are to be generated after the DASDInfo.i.thresh threshold has been crossed, but before all of the allotted disk space has been used. SrvName The computer name of the server to enumerate the directory limits on Note The server computer name can be specified as '' for a local server. Example /* Enumerate DASD directory limit on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASD = 750 DASDInfo.DirPath = 'D:\APPS\DATA' DASDInfo.recursive = 1 DASDInfo.BufferSize = 4096 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETDASD, 'DASDInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc exitRc = 9 end else do say 'Directory limit enumeration returned' say 'Number entries available' DASDInfo.EntriesAvail say 'Number entries returned ' DASDInfo.count say 'First dir path ' DASDInfo.1.resource_name say 'First limit size ' DASDInfo.1.max say 'First limit usage ' DASDInfo.1.use say 'Threshold ' DASDInfo.1.thresh say 'Delta ' DASDInfo.1.delta exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Directory limit enumeration returned Number entries available 1 Number entries returned 1 First dir path First limit size 512 First limit usage 102 Threshold 90 Delta 5 ═══ 11.9. NETFILE Enumerate ═══ The function returns information about some or all open files on a server. Syntax MyRc = NetEnumerate(NETFILE, 'fileInfo', SrvName) MyRc = NetEnumerate(NETFILE, 'fileInfo', SrvName, BasePath) MyRc = NetEnumerate(NETFILE, 'fileInfo', SrvName, BasePath, UserId) Parameters The parameters specified are: 'fileInfo' The REXX variable receiving the result. The variable is divided into: fileInfo.count The number of open files. The same value is available in the variable fileInfo.0 fileInfo.i.id The file id i, where the variable i has a value from 1 to fileInfo.count fileInfo.i.permissions Indicates the access permissions of the file opening. It is a hexedecimal value combined of the following: Hex Value What --------- --------------------------------------- 0x1 Permission to read a resource and by default, execute the resource. 0x2 Permission to write to a resource. 0x4 Permission to create a resource. Data can be written when creating the resource. fileInfo.i.num_locks The number of file locks on the file, device, or pipe. fileInfo.i.pathname The path name i, where the variable i has a value from 1 to fileInfo.count fileInfo.i.username The name of the userid that opened the resource. fileInfo.frk On server with many open files, the fileInfo.frk parameter can be used to get a partial enumeration, process the returned information and resume open file enumeration. To control this operation the value 'INITRESUME' must be specified on the first call and 'RESUME' on the following calls until the returned number of open files is 0 (fileInfo.count) fileInfo.frkMoreData This variable will be set to 234 (ERROR_MORE_DATA) if there is more data available, otherwise the value will be 0 fileInfo.frkBuffer The internal binary work buffer size for the fileInfo.frk control parameter. The size should be from 1024 to 65535 bytes. The default value is 4096 bytes This buffer size is used on every call to hold the binary data, that will be formatted into the returned REXX variables SrvName The server computer name. If the server computer name is '', it is a call to the local server BasePath The base path to the open files. For example is 'C:\' a base path UserId A userid to enumerate open files on Note The server computer name can be specified as '' for a local server. There are 3 different calls to NetEnumerate(NETFILE). They are not identical if one or more specified parameters have the value ''. An example without the resume key /* List open files on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETFILE = 60 SrvName = '\\DOMAIN_CONTRLR' BasePath = 'C:' UserId = 'ADMIN04' myRc = NetEnumerate(NETFILE, 'fileInfo', SrvName, BasePath, UserId) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if fileInfo.count = 0 then do say 'No files open on the server' call DropLsRxutFuncs exit 0 end say 'Number of open file entries: ' fileInfo.count say do i=1 to fileInfo.count say 'Id ' fileInfo.i.id say 'Permissions ' fileInfo.i.permissions say 'Number locks ' fileInfo.i.num_locks say 'Path Name ' fileInfo.i.pathname say 'Opening Userid' fileInfo.i.username say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of open file entries: 2 Id 142218 Permissions 1 Number locks 0 Path Name C:\OS2\VIEW.EXE Opening Userid ADMIN04 Id 142250 Permissions 1 Number locks 0 Path Name C:\OS2\VIEWDOC.EXE Opening Userid ADMIN04 An example with the resume key /* Net enumerate open files using resume operation */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETFILE = 60 SrvName = '\\KING_BALU' BasePath = '' UserId = 'ADMIN04' fileInfo.frkBuffer = 512 fileInfo.resumekey = 'INITRESUME' myRc = NetEnumerate(NETFILE, 'fileInfo', SrvName) /* Process the file information and test the fileInfo.frkMoreData variable. If 234 then make the following call fileInfo.resumekey = 'RESUME' myRc = NetEnumerate(NETFILE, 'fileInfo', SrvName) */ if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc ExitRc = 9 end else do if fileInfo.count = 0 then do say 'No files open on the server specified' ExitRc = 0 end else do say 'Number of open file entries: ' fileInfo.count say do i=1 to fileInfo.count say 'Id ' fileInfo.i.id say 'Permissions ' fileInfo.i.permissions say 'Number locks ' fileInfo.i.num_locks say 'Path Name ' fileInfo.i.pathname say 'Opening Userid' fileInfo.i.username say end end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode ═══ 11.10. NETGROUP Enumerate ═══ The function lists all group accounts on the UAS database. Syntax MyRc = NetEnumerate(NETGROUP, 'groupInfo') MyRc = NetEnumerate(NETGROUP, 'groupInfo', SrvName) Parameters The parameters specified are: 'groupInfo' The REXX variable receiving the result. The variable is divided into: groupInfo.0 The number of groups groupInfo.i The group name i, where the variable i has a value from 1 to groupInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server. There call to NetEnumerate with 2 parameters is identical to the call with 3 parameters where SrvName is set to ''. Example /* List group names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUP = 70 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETGROUP, 'groupInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if groupInfo.0 = 0 then do say 'No group names found. You may have a problem.' call DropLsRxutFuncs exit 0 end say 'Number of group names: ' groupInfo.0 say do i=1 to groupInfo.0 say groupInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of group names: 10 GROUPID GROUP200 GROUP201 GROUP202 SERVERS ACLGROUP LOCAL USERS ADMINS GUESTS ═══ 11.11. NETLOGON Enumerate ═══ The function enumerates logged on user accounts. Syntax MyRc = NetEnumerate(NETLOGON, 'logonInfo') MyRc = NetEnumerate(NETLOGON, 'logonInfo', SrvName) Parameters The parameters specified are: 'logonInfo' The REXX variable receiving the result. The variable is divided into: logonInfo.0 The number of user account names logged on logonInfo.i The user account name i, where the variable i has a value from 1 to logonInfo.0 SrvName The server computer name. If the server computer name is '', this will be identical as a call to NetEnumerate(NETLOGON) with only two parameters (local server) Note The server computer name can be specified as '' for a local server. Example /* List logged on users accounts */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETLOGON = 50 SrvName = '\\ITSCSV00' myRc = NetEnumerate(NETLOGON, 'logonInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if logonInfo.0 = 0 then do say 'No user accounts logged on' call DropLsRxutFuncs exit 0 end say 'Number of user entries: ' logonInfo.0 say do i=1 to logonInfo.0 say logonInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of user entries: 9 BERIT A948R11 ITSCAIX1 SHIMIZU A948R29 N$HUY A948R33 JACOBB A948R30 ═══ 11.12. NETMESSAGENAME Enumerate ═══ The function lists the name entries in a message name table. Syntax MyRc = NetEnumerate(NETMESSAGENAME, 'msgNameInfo') MyRc = NetEnumerate(NETMESSAGENAME, 'msgNameInfo', SrvName) Parameters The parameters specified are: 'msgNameInfo' The REXX variable receiving the result. The variable is divided into: msgNameInfo.0 The number of message name entries msgNameInfo.i The message name entry i, where the variable i has a value from 1 to msgNameInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or requester. There call to NetEnumerate with 2 parameters is identical to the call with 3 parameters where SrvName is set to ''. Example /* List message names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAME = 80 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETMESSAGENAME, 'msgNameInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if msgNameInfo.0 = 0 then do say 'No message name registered' call DropLsRxutFuncs exit 0 end say 'Number of message names: ' msgNameInfo.0 say do i=1 to msgNameInfo.0 say msgNameInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of message names: 1 DOMAIN_CONTRLR ═══ 11.13. NETPRINTDEST Enumerate ═══ The function returns a list of print devices. Syntax MyRc = NetEnumerate(NETPRINTDEST, 'printDestInfo') MyRc = NetEnumerate(NETPRINTDEST, 'printDestInfo', SrvName) Parameters The parameters specified are: 'printDestInfo' The REXX variable receiving the result. The variable is divided into: printDestInfo.0 The number of print devices printDestInfo.i The print device name entry i, where the variable i has a value from 1 to printDestInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or computer. There call to NetEnumerate with 2 parameters is identical to the call with 3 parameters where SrvName is set to ''. Example /* List print destination names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTDEST = 100 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETPRINTDEST, 'printDestInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if printDestInfo.0 = 0 then do say 'No print destinations available' call DropLsRxutFuncs exit 0 end say 'Number of print destination names: ' printDestInfo.0 say do i=1 to printDestInfo.0 say printDestInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of print destination names: 1 LPT1Q ═══ 11.14. NETPRINTDRIVER Enumerate ═══ The function retrieves a list of printer presentation drivers on a server or workstation. Syntax MyRc = NetEnumerate(NETPRINTDRIVER, 'prtDriverInfo', SrvName) Parameters The parameters specified are: 'prtDriverInfo' The REXX variable receiving the result. The variable is divided into: prtDriverInfo.0 The number of printer presentation drivers prtDriverInfo.i Printer presentation driver name entry i, where the variable i has a value from 1 to prtDriverInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local computer. Example /* List printer presentation drivers */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTDRIVER = 310 SrvName = '' myRc = NetEnumerate(NETPRINTDRIVER, 'prtDriverInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if prtDriverInfo.0 = 0 then do say 'No print drivers available' call DropLsRxutFuncs exit 0 end say 'Number of printer presentation drivers defined: ' prtDriverInfo.0 say do i=1 to prtDriverInfo.0 say prtDriverInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of printer presentation drivers defined: 2 PSCRIPT.IBM 4019 v52_1 (39 Fonts) IBMNULL ═══ 11.15. NETPRINTJOB Enumerate ═══ The function returns a list of print jobs in a print queue. Syntax MyRc = NetEnumerate(NETPRINTJOB, 'printJobInfo', SrvName, QueueName) Parameters The parameters specified are: 'printJobInfo' The REXX variable receiving the result. The variable is divided into: printJobInfo.count The number of print jobs in the queue printJobInfo.i.JobId The print job identification entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Priority The print job priority entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Position The print job position in the queue entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Status The print job status in the queue entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Size The print job size entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.UserName The userid entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Document The document name entry i, where the variable i has a value from 1 to printJobInfo.count printJobInfo.i.Comment The comment entry i, where the variable i has a value from 1 to printJobInfo.count SrvName The server computer name QueueName The queue name, which must be supplied Note The server computer name can be specified as '' for a local server or computer. Example /* List print jobs in a print queue */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTJOB = 110 SrvName = '\\DOMAIN_CONTRLR' QueueName = 'LPT1Q' myRc = NetEnumerate(NETPRINTJOB, 'printJobInfo', SrvName, QueueName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if printJobInfo.count = 0 then do say 'No print jobs in printer queue' call DropLsRxutFuncs exit 0 end say 'Number of print jobs: ' printJobInfo.count do i=1 to printJobInfo.count say say 'Job Id: ' printJobInfo.i.JobId say 'Userid: ' printJobInfo.i.UserName say 'Document name: ' printJobInfo.i.Document end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of print jobs: 2 Job Id: 12 Userid: ADMIN04 Document name: Unknown Job Id: 14 Userid: ADMIN04 Document name: Unknown ═══ 11.16. NETPRINTPORT Enumerate ═══ The function retrieves a list of printer ports on a server or workstation. Syntax MyRc = NetEnumerate(NETPRINTPORT, 'prtPortInfo', SrvName) Parameters The parameters specified are: 'prtPortInfo' The REXX variable receiving the result. The variable is divided into: prtPortInfo.0 The number of printer ports prtPortInfo.i Port name entry i, where the variable i has a value from 1 to prtPortInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local computer. Example /* List printer ports */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTPORT = 300 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETPRINTPORT, 'prtPortInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if prtPortInfo.0 = 0 then do say 'No printer ports available' call DropLsRxutFuncs exit 0 end say 'Number of printer ports defined: ' prtPortInfo.0 say do i=1 to prtPortInfo.0 say prtPortInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of printer ports defined: 8 FILE COM4 COM3 COM2 COM1 LPT3 LPT2 LPT1 ═══ 11.17. NETPRINTQPROC Enumerate ═══ The function retrieves a list of printer queue processors on a server or workstation. Syntax MyRc = NetEnumerate(NETPRINTQPROC, 'prtQProcInfo', SrvName) Parameters The parameters specified are: 'prtQProcInfo' The REXX variable receiving the result. The variable is divided into: prtQProcInfo.0 The number of printer queue processors prtQProcInfo.i Printer queue processor name entry i, where the variable i has a value from 1 to prtQProcInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local computer. Example /* List printer queue processors */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTQPROC = 320 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETPRINTQPROC, 'prtQProcInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if prtQProcInfo.0 = 0 then do say 'No printer queue processor defined' call DropLsRxutFuncs exit 0 end say 'Number of entries: ' prtQProcInfo.0 say do i=1 to prtQProcInfo.0 say prtQProcInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 1 PMPRINT ═══ 11.18. NETPRINTQUEUE Enumerate ═══ The function returns a list of print queues. Syntax MyRc = NetEnumerate(NETPRINTQUEUE, 'printQInfo', SrvName) Parameters The parameters specified are: 'printQInfo' The REXX variable receiving the result. The variable is divided into: printQInfo.0 The number of print queues printQInfo.i The print queue name entry i, where the variable i has a value from 1 to printQInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server or computer. Example /* List print queue names */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTQUEUE = 120 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETPRINTQUEUE, 'printQInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if printQInfo.0 = 0 then do say 'No printer queues defined' call DropLsRxutFuncs exit 0 end say 'Number of printer queue names: ' printQInfo.0 say do i=1 to printQInfo.0 say printQInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of printer queue names: 6 LPT1Q PS203 PCL203 PS202 PCL202 IBM4029 ═══ 11.19. NETSERVERDISK Enumerate ═══ The function retrieves a list of diskette and disk drives on a server. Syntax MyRc = NetEnumerate(NETSERVERDISK, 'srvDiskInfo', SrvName) Parameters The parameters specified are: 'srvDiskInfo' The REXX variable receiving the result. The variable is divided into: srvDiskInfo.0 The number of disk drives available on the server specified srvDiskInfo.i The disk drive name entry i, where the variable i has a value from 1 to srvDiskInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* List disk drives on a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVERDISK = 150 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETSERVERDISK, 'srvDiskInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if srvDiskInfo.0 = 0 then do say 'No server disk drives' call DropLsRxutFuncs exit 0 end say 'Number of disk drives: ' srvDiskInfo.0 say do i=1 to srvDiskInfo.0 say srvDiskInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of disk drives: 7 A: B: C: D: E: F: G: ═══ 11.20. NETSERVER Enumerate ═══ The function list all servers visible on the network. Syntax MyRc = NetEnumerate(NETSERVER, 'serverList') MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName) MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType) MyRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType, DomainName) Parameters The parameters specified are: 'serverList' The REXX variable receiving the result. The variable is divided into: serverList.0 The number of servers found serverList.i The server computer name entry i, where the variable i has a value from 1 to serverList.0 SrvType The server type values are defined as follows: SV_TYPE_WORKSTATION = 1 /* Workstation */ SV_TYPE_SERVER = 2 /* Server */ SV_TYPE_SQLSERVER = 4 /* SQL server */ SV_TYPE_DOMAIN_CTRL = 8 /* Domain controller */ SV_TYPE_DOMAIN_BAKCTRL = 16 /* Backup domain controller */ SV_TYPE_TIME_SOURCE = 32 /* Time server */ SV_TYPE_AFP = 64 /* Apple File Protocol (AFP) service */ SV_TYPE_NOVELL = 128 /* Novell service */ SV_TYPE_ALL = -1 /* All types of servers */ SrvName The server computer name DomainName The domain name Note The server computer name can be specified as '' for a local server or workstation. The default values in the four different call forms are as follows: 2 parms The function executes on the local computer, list all domain controllers found in the logon domain and domains found in the 'other Domains' parameter 3 parms The function executes on the computer specified, list all domain controllers found in the logon domain and domains found in the 'other Domains' parameter 4 parms The function executes on the computer specified, list the server types specified in the logon domain and domains found in the 'other Domains' parameter 5 parms The function executes on the computer specified, list the server types specified in the domain specified Example /* Get the domain controller computer name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVER = 160 SrvName = '\\DOMAIN_CONTRLR' SrvType = 8 /* Domain Controller */ DomainName = 'ITSO_AUSTIN_442' myRc = NetEnumerate(NETSERVER, 'serverList', SrvName, SrvType, DomainName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if serverList.0 = 0 then do say 'Domain controller was not found' call DropLsRxutFuncs exit 0 end say 'Number of servers found: ' serverList.0 say do i=1 to serverList.0 say serverList.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of servers found: 1 DOMAIN_CONTRLR ═══ 11.21. NETSERVICE Enumerate ═══ The function retrieves a list of all network services that are started. Syntax MyRc = NetEnumerate(NETSERVICE, 'serviceInfo', SrvName) Parameters The parameters specified are: 'serviceInfo' The REXX variable receiving the result. The variable is divided into: serviceInfo.0 The number of services started serviceInfo.i The started service name entry i, where the variable i has a value from 1 to serviceInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* List service names started on computer */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVICE = 170 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETSERVICE, 'serviceInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if serviceInfo.0 = 0 then do say 'No service listed as started' call DropLsRxutFuncs exit 0 end say 'Number of services started: ' serviceInfo.0 say do i=1 to serviceInfo.0 say serviceInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of services started: 8 REQUESTER MESSENGER SERVER NETLOGON LSSERVER ALERTER NETRUN TIMESOURCE ═══ 11.22. NETSESSION Enumerate ═══ The function retrieves a list of computer names having a session to a server. Syntax MyRc = NetEnumerate(NETSESSION, 'sessionInfo', SrvName) Parameters The parameters specified are: 'sessionInfo' The REXX variable receiving the result. The variable is divided into: sessionInfo.0 The number of sessions sessionInfo.i The computer name entry i, where the variable i has a value from 1 to sessionInfo.0 sessionInfo.i.username The name of the userid who established the session sessionInfo.i.num_conns The number of connections that have been made during the session sessionInfo.i.num_opens The number of files, devices, and pipes that have been opened during the session sessionInfo.i.num_users The number of sessions that are established between the server and the requester sessionInfo.i.time The number of seconds a session has been active sessionInfo.i.idle_time The number of seconds a session has been idle sessionInfo.i.user_flags The manner in which the user established the session. The bit mask for user_flags is defined as follows: Value What ----- ---------------------------------------------- 1 Established the session using a GUEST account 2 Established the session without using password encryption sessionInfo.i.cltype_name The type of client that established the session Type What ----------- ------------------------------------------------ Down Level Old clients; for example, LAN Server 1.0 clients DLR 2.0 DLR 2.0 clients OS/2 LS 1.3 OS/2 LAN Server 1.3 clients OS/2 LS 3.0 OS/2 LAN Server 3.0 clients OS/2 LS 4.0 OS/2 LAN Server 4.0 clients SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* List computer names having a session to a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSESSION = 180 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETSESSION, 'sessionInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if sessionInfo.0 = 0 then do say 'No session established on server' call DropLsRxutFuncs exit 0 end say 'Number of computers having a session to server: ' sessionInfo.0 say do i=1 to sessionInfo.0 say sessionInfo.i say sessionInfo.i.username say sessionInfo.i.num_conns say sessionInfo.i.num_opens say sessionInfo.i.num_users say sessionInfo.i.time say sessionInfo.i.idle_time say sessionInfo.i.user_flags say sessionInfo.i.cltype_name say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of computers having a session to server: 1 ITSCWK21 ADMIN04 4 2 1 14956 0 0 OS/2 LS 3.0 ═══ 11.23. NETSHARE Enumerate ═══ The function retrieves a list of current shares on a server. Syntax MyRc = NetEnumerate(NETSHARE, 'shareInfo', SrvName) Parameters The parameters specified are: 'shareInfo' The REXX variable receiving the result. The variable is divided into: shareInfo.0 The number of netnames shared shareInfo.i The netname entry i, where the variable i has a value from 1 to shareInfo.0 SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* List shared netnames on a server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 SrvName = '\\DOMAIN_CONTRLR' myRc = NetEnumerate(NETSHARE, 'shareInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if shareInfo.1 = 0 then do say 'Server does not share a resource' call DropLsRxutFuncs exit 0 end say 'Number of shared netnames: ' shareInfo.0 say do i=1 to shareInfo.0 say shareInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of shared netnames: 19 IPC$ ADMIN$ A$ B$ C$ D$ E$ F$ G$ NETLOGON IBMLAN$ BIGTREE EDRIVE MO COM1Q VXREXX TOOLKIT LPT1Q USER300 ═══ 11.24. NETUSE Enumerate ═══ The function lists all current connections between the local computer and resources on a remote server. Syntax MyRc = NetEnumerate(NETUSE, 'useInfo', SrvName) Parameters The parameters specified are: 'useInfo' The REXX variable receiving the result. The variable is divided into: useInfo.count The number of net uses. The same information is stored in the variable useInfo.0 useInfo.i.local The local device entry i, where the variable i has a value from 1 to useInfo.count useInfo.i.remote The UNC name entry i, where the variable i has a value from 1 to useInfo.count useInfo.i.status Tthe status of the connection entry i where the variable i has a value from 1 to useInfo.count useInfo.i.asg_type The type of remote resource being accessed entry i, where the variable i has a value from 1 to useInfo.count useInfo.i.refcount The number of files, directories, and other processes that are open on the remote resource for entry i useInfo.i.usecount The number of explicit connections (redirection of a local device name) or implicit UNC connections (redirection of a null local device name) that are established with the resource for entry i SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* List net uses */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 SrvName = '' /* On this local computer */ /* SrvName = '\\DOMAIN_CONTRLR' */ myRc = NetEnumerate(NETUSE, 'useInfo', SrvName) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if useInfo.count = 0 then do say 'No net uses are active' call DropLsRxutFuncs exit 0 end say 'Number of net uses: ' useInfo.count do i=1 to useInfo.count say say useInfo.i.local say useInfo.i.remote end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of net uses: 3 Y: \\DOMAIN_CONTRLR\C$ LPT2 \\DOMAIN_CONTRLR\LPT1Q UNC connection \\DOMAIN_CONTRLR\IPC$ ═══ 11.25. 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: userInfo.0 The number of users userInfo.i User name entry i, where the variable i has a value from 1 to userInfo.0 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 ═══ 11.26. NETUSERGROUPS Enumerate ═══ The function lists the names of all groups in the user accounts subsystem (UAS) database to which a particular user account belongs. This function is identical to NetGetInfo(NETUSERGROUPS). Syntax MyRc = NetEnumerate(NETUSERGROUPS, 'userGroups', SrvName, UserId) Parameters The parameters specified are: 'userGroups' The REXX variable receiving the result. The variable is divided into: userGroups.0 The number of groups in which the user account has a entry userGroups.i The actual group names SrvName The server computer name UserId The userid Note The server computer name can be specified as '' for a local server or computer. Example /* Get the groups in which a user account is defined */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERGROUPS = 330 SrvName = '\\DOMAIN_CONTRLR' UserId = 'USERID' myRc = NetEnumerate(NETUSERGROUPS, 'userGroups', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetEnumerate() ' myRc call DropLsRxutFuncs exit 9 end if userGroups.0 = 0 then do say 'User account belongs to no group' call DropLsRxutFuncs exit 0 end say 'Number of entries: ' userGroups.0 say do i=1 to userGroups.0 say 'Group Name: ' userGroups.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 1 Group Name: ADMINS ═══ 12. NetGetInfo ═══ The Net Get Information functions are a family of functions that can be called with a number of parameters. The use of the NetGetInfo has two to five different parameters. The generic syntax is: MyRc = NetGetInfo(option, 'StemVar', parm1, parm2, parm3) The option parameter contains a value to determine the type or option information is obtained from. An example would be the information of a user account. The StemVar parameter is specified in quotes. It will contain the resulting information from the NetGetInfo function. The parm1, parm2, parm3 parameters are dependent on the performed option. The MyRc parameter is the return code that will have an value from the NetGetInfo() function. If the call is successful the character '0' will be returned. Otherwise an error code and descriptive text are inserted by NetGetInfo() function. The option parameter values are defined in Option parameter values. ═══ 12.1. NETACCESS GetInfo ═══ NETACCESS GetInfo function retrieves information about the access control profile for a resource. The resource can either be a directory, a file, a pipe, a spooler queue or a serial device queue. Syntax MyRc = NetGetInfo(NETACCESS, 'Access', ServerName, ResourceName) Parameters The parameters specified are: 'Access' The REXX variable receiving the result. The variable is divided into: Access.count The number of access controls profiles available for the resource Access.audit The auditing flags. The flags are defined as: - A Audit all. When this bit is set, all access attempts will be audited. - O If O, audit successful file opens. - W If W, audit successful file writes and successful directory creates. - D If D, audit successful file deletes or truncates and successful directory deletes. - P If P, audit successful file and directory access control profile change. - o If o, audit failed file opens. - w If w, audit failed file writes and failed directory creates. - d If d, audit failed file deletes or truncates and failed directory deletes. - p If d, audit failed file and directory access control profile change. - -none- or N Do not perform any auditing Access.i.ugname The user account or group name. The variable i has a value from 1 to Access.count Access.i.access The access profile. The variable i is specified as above. The access control flags are as follows: - N None - A Attribute - R Read - W Write - C Create - X Execute - D Delete - P Permissions - G This is a Group permission ServerName The server computer name Resource Name The name of the resource Note The serverName parameter can be specified as '' for a local server. Example /* Add a access control profile for a resource */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESS = 10 SrvName = '\\FSC30DCR' ResourceName = 'D:\APPS\NETPROG' myRc = NetGetInfo(NETACCESS, 'Access', SrvName, ResourceName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Count: ' Access.count say 'Audit: ' Access.audit do i=1 to Access.count say say Access.i.ugname say Access.i.access end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Count: 2 Audit: owdp USERS RG GUESTS RG ═══ 12.2. NETACCESSUSERPERMS Get Info ═══ The function obtains for a specified userid or group the permission to a resource. The resource can be a file, directory, drive, pipe, queue or logical resource and can be specified remotely by a UNC path. Syntax MyRc = NetGetInfo(NETACCESSUSERPERMS, 'UsrPerms', SrvName, NetResName, UgName) Parameters The parameters specified are 'UsrPerms' The REXX variable receiving the result. The variable is divided into: UsrPerms.perms The access control profile available for the resource. The access control flags are as follows: - N None - A Attribute - R Read - W Write - C Create - X Execute - D Delete - P Permissions SrvName The server computer name NetResName The name of the resource UgName User account or group name Note The server computer name can be specified as '' for a local server. Example /* Get access control profile for a resource and a user or group */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESSUSERPERMS = 12 SrvName = '\\FSC30DCR' NetResName = 'C:\IBMLAN\NETPROG' UgName = 'USERS' MyRc = NetGetInfo(NETACCESSUSERPERMS, 'UsrPerms', SrvName, NetResName, UgName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Access Perms: ' UsrPerms.perms call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Access Perms: R ═══ 12.3. NETALIAS Get Info ═══ The function retrieves information about the specified alias. Syntax MyRc = NetGetInfo(NETALIAS, 'AliasInfo', SrvName, Alias) Parameters The parameters specified are: 'AliasInfo' The REXX variable receiving the result. The variable is divided into: AliasInfo.name The alias name AliasInfo.remark The alias remark AliasInfo.server The computer name of the server where the resource described by this alias resides AliasInfo.netname The alias name for files aliases, and the queue name for printer and serial device aliases AliasInfo.location The alias location AliasInfo.mode When the alias is shared AliasInfo.maxuses The maximum number of users who can have redirection to the resource identified by this alias AliasInfo.type The alias type AliasInfo.queue The queue name for serial or printer alias only AliasInfo.path The path for files alias only AliasInfo.priority The serial device priority AliasInfo.device_pool The serial device pool SrvName The server computer name Alias The alias name Note The server computer name can be specified as '' for a local server. Example /* Get alias information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETALIAS = 20 SrvName = '\\FSC30DCR' Alias = 'FORALL' MyRc = NetGetInfo(NETALIAS, 'AliasInfo', SrvName, Alias) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Alias Name: ' aliasInfo.name say 'Alias Remark: ' aliasInfo.remark say 'Alias Server: ' aliasInfo.server say 'Alias NetName: ' aliasInfo.netname say 'Alias Location: ' aliasInfo.location say 'Alias Mode: ' aliasInfo.mode say 'Alias Max uses: ' aliasInfo.maxuses say 'Alias Type: ' aliasInfo.type say 'Alias Queue: ' aliasInfo.queue say 'Alias path: ' aliasInfo.path say 'Alias priority: ' aliasInfo.priority say 'Alias device pool: ' aliasInfo.device_pool call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Alias Name: FORALL Alias Remark: For all users Alias Server: \\FSC30DCR Alias NetName: FORALL Alias Location: Within Domain Alias Mode: At Requester use Alias Max uses: 45 Alias Type: Files Alias Queue: Unknown Alias path: D:\APPS\BOOKS Alias priority: Unknown Alias device pool: Unknown ═══ 12.4. NETAPP Get Info ═══ The function retrieves information about an application. Syntax MyRc = NetGetInfo(NETAPP, 'AppInfo', SrvName, Application) MyRc = NetGetInfo(NETAPP, 'AppInfo', SrvName, Application, UserId) Parameters The function call can be either with four or five parameters. The parameters specified are: 'AppInfo' The REXX variable receiving the result. The variable is divided into: AppInfo.name The application name AppInfo.remark The application remark AppInfo.command The command that starts the application AppInfo.command_parms The application start parameters AppInfo.app_alias_or_drv The alias or drive where the application resides. It specifies a drive letter, followed by a colon (:), if the application resides on the user's local machine or it specifies an existing alias if the application resides on a server AppInfo.app_drive Applies to DOS public applications only. It is used to specify the drive that is current when the application runs. A value of * indicates that the system should choose a drive letter AppInfo.app_path_to_dir The remaining path to the application AppInfo.wrkdir_alias_or_drv Specifies the directory that is made current when the application runs. If the working directory is on the local machine, it specifies the drive, where the directory is located. If the working directory is remote, it specifies an existing alias where the directory is located AppInfo.wrkdir_drive Specifies the drive that the working directory is to be assigned to when the application is started. A value of * indicates that the system should choose a drive when the application is started AppInfo.wrkdir_path_to_dir The remaining path to the working directory AppInfo.prompt Prompt for parameters AppInfo.interface The interface type AppInfo.type The application type AppInfo.res_count The number of application resource list that follows. A value of zero indicates that the application does not require any redirected devices when it runs AppInfo.i.arl_alias The alias for the resource required by the application. The variable i has a value from 1 to AppInfo.res_count AppInfo.i.arl_device The device assigned to the resource specified. The variable i has a value from 1 to AppInfo.res_count SrvName The server computer name Application The application name UserId The userid. The userid must be specified for private applications Note The server computer name can be specified as '' for a local server. Using UserId = '' is identical to calling NetGetInfo(NETAPP) without the UserId parameter. Example /* Get application information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPP = 30 SrvName = '\\ILIDC' Application = 'THENEW' MyRc = NetGetInfo(NETAPP, 'AppInfo', SrvName, Application) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say 'App Name: ' AppInfo.name say 'App Remark: ' AppInfo.remark say 'App Command: ' AppInfo.command say 'App Command parms: ' AppInfo.command_parms say 'App alias or drive: ' AppInfo.app_alias_or_drv say 'App drive: ' AppInfo.app_drive say 'App path to dir: ' AppInfo.app_path_to_dir say 'App wrkdir alias or drv: ' AppInfo.wrkdir_alias_or_drv say 'App wrkdir drive: ' AppInfo.wrkdir_drive say 'App wrkdir path to dir: ' AppInfo.wrkdir_path_to_dir say 'App prompt: ' AppInfo.prompt say 'App interface type: ' AppInfo.interface say 'App type: ' AppInfo.apptype say 'App resource count: ' AppInfo.res_count if AppInfo.res_count <> 0 then do do i=1 to AppInfo.res_count say say "Alias: " AppInfo.i.arl_alias say "Device:" AppInfo.i.arl_device end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output App Name: THENEW App Remark: The New application App Command: myapp.exe App Command parms: App alias or drive: C: App drive: N/A App path to dir: \ App wrkdir alias or drv: D: App wrkdir drive: Local App wrkdir path to dir: \ App prompt: Prompt user for parameters App interface type: Presentation Manager App type: Public OS/2 application App resource count: 2 Alias: BOOKS Device: * Alias: MYDEMO Device: U ═══ 12.5. NETAPPSEL Get Info ═══ The function retrieves information about all types of applications contained in the specified userid desktop application folders. Syntax MyRc = NetGetInfo(NETAPPSEL, 'appSelInfo', SrvName, UserId) Parameters The parameters specified are: 'appSelInfo' The REXX variable receiving the result. The variable is divided into: appSelInfo.count The count of application selector entries returned appSelInfo.i.appname The application name. The variable i has a value 1 to appSelInfo.count appSelInfo.i.apptype The application type. The variable i, see above SrvName The server computer 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 application selector information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETAPPSEL = 32 SrvName = '\\ILIDC' UserId = 'FMAM' myRc = NetGetInfo(NETAPPSEL, 'appSelInfo', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end if appSelInfo.count <> 0 then do say 'Number of entries: ' appSelInfo.count do i=1 to appSelInfo.count say say 'Application entry: ' i say 'Application Name: ' appSelInfo.i.appname say 'Application type: ' appSelInfo.i.apptype end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 2 Application entry: 1 Application Name: ALLAPPS Application type: Public OS/2 application Application entry: 2 Application Name: THENEW Application type: Public OS/2 application ═══ 12.6. NETBIOS Get Info ═══ The function returns information about a particular network device driver installed on a computer. Syntax MyRc = NetGetInfo(NETBIOS, 'netBiosInfo', SrvName, NetName) Parameters The parameters specified are: 'netBiosInfo' The REXX variable receiving the result. The variable is divided into: netBiosInfo.name The name of the network. For example 'NET1' or 'NETLB' netBiosInfo.driver_name The network device driver name that the LAN Server software uses netBiosInfo.lana_num The LAN adapter number netBiosInfo.driver_type The device driver protocol type netBiosInfo.net_status The status of the device driver netBiosInfo.net_bandwidth The number of bytes per second that the network hardware accommodates netBiosInfo.max_sess The maximum number of concurrent sessions that the device driver can establish netBiosInfo.max_ncbs The maximum number of NCBs that can be outstanding at any time netBiosInfo.max_names The maximum number of network names that a network (netBiosInfo.name) can establish SrvName The server computer name NetName The network name Note The server computer name can be specified as '' for a local server or computer. Example /* Get NetBios information for NET1 */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETBIOS = 90 SrvName = '\\FSC30DCR' NetName = 'NET1' myRc = NetGetInfo(NETBIOS, 'netBiosInfo', SrvName, NetName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "Netbios net_name: " netBiosInfo.net_name say "Netbios driver_name: " netBiosInfo.driver_name say "Netbios lana num: " netBiosInfo.lana_num say "Netbios driver_type: " netBiosInfo.driver_type say "Netbios net status: " netBiosInfo.net_status say "Netbios net bandwidth:" netBiosInfo.net_bandwidth say "Netbios max sessions: " netBiosInfo.max_sess say "Netbios max ncbs: " netBiosInfo.max_ncbs say "Netbios max names: " netBiosInfo.max_names call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Netbios net_name: NET1 Netbios driver_name: NETBEUI$ Netbios lana num: 0 Netbios driver_type: Network Control Block Protocol Netbios net status: The network software is started. Netbios net bandwidth: 524288 Netbios max sessions: 32 Netbios max ncbs: 50 Netbios max names: 14 ═══ 12.7. NETCHARDEV Get Info ═══ The function retrieves information about a particular serial device in a shared serial device queue on a server. Syntax MyRc = NetGetInfo(NETCHARDEV, 'charDevInfo', SrvName, DeviceName) Parameters The parameters specified are: 'charDevInfo' The REXX variable receiving the result. The variable is divided into: charDevInfo.dev The device name charDevInfo.status The status of the device charDevInfo.username The current user name of the device charDevInfo.time The number of seconds the current application has been connected to the serial device SrvName The server computer name DeviceName The name of the device Note The server computer name can be specified as '' for a local server or computer. Example /* Get the serial device information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCHARDEV = 130 SrvName = '\\ILIDC' DeviceName = 'COM1' myRc = NetGetInfo(NETCHARDEV, 'charDevInfo', SrvName, DeviceName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'The device name: ' charDevInfo.dev say 'Device status: ' charDevInfo.status say 'Current user name: ' charDevInfo.username say 'Time in use: ' charDevInfo.time call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output The device name: COM1 Device status: Idle Current user name: -none- Time in use: 0 ═══ 12.8. NETCHARDEVQ Get Info ═══ The function retrieves information about a particular serial device queue on a server. Syntax MyRc = NetGetInfo(NETCHARDEVQ, 'charQInfo', SrvName, QueueName, UserId) Parameters The parameters specified are: 'charQInfo' The REXX variable receiving the result. The variable is divided into: charQInfo.dev The name of the serial device queue for which information is returned charQInfo.priority The queue priority charQInfo.devs The names of the local devices in the pool charQInfo.numusers The number of users waiting in the device queue charQInfo.numahead The number of users ahead of the UserId specified in the call the NetGetInfo(CHARDEVQ) SrvName The server computer name QueueName The name of the queue. This name is identical to the netname UserId The name of the userid Note The server computer name can be specified as '' for a local server. Example /* Get queue information for a serial device */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCHARDEVQ = 140 SrvName = '\\ILIDC' QueueName = 'SRVCOM' UserId = 'LINDBERG' myRc = NetGetInfo(NETCHARDEVQ, 'charQInfo', SrvName, QueueName, UserId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Device name: ' charQInfo.dev say 'Queue Priority: ' charQInfo.priority say 'Queue server devices: ' charQInfo.devs say 'Numbers users waiting: ' charQInfo.numusers say 'Number users ahead of ' UserId ':' charQInfo.numahead call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Device name: SRVCOM Queue Priority: 3 Queue server devices: COM1 Numbers users waiting: 0 Number users ahead of LINDBERG : Userid has no requests in the queue ═══ 12.9. NETCONNECTION Get Info ═══ The function returns a list of connections made to a shared resource of a server, or a list of all connections established from a particular computer to a server. This function is identical identical to NetEnumerate(NETCONNECTION). Syntax MyRc = NetGetInfo(NETCONNECTION, 'connInfo', SrvName, Qualifier) Parameters The parameters specified are: 'connInfo' The REXX variable receiving the result. The variable is divided into: connInfo.num_entries The number of connection information entries. Each entry is obtained by the index i, which has a value from 1 to connInfo.num_entries connInfo.i.id The connection id connInfo.i.type The type of connection made from the local device name to the shared resource connInfo.i.num_opens The number of files that are currently open as a result of the connection connInfo.i.num_users The number of users on the connection connInfo.i.time The number of seconds the connection has been established connInfo.i.username The name of the user that made the connection connInfo.i.netname A string indicating either the netname of the shared resource of the server or the computer name of the requester, depending on which name was specified as the Qualifier parameter SrvName The server computer name Qualifier A string specifying either the netname of the shared resource whose connections will be listed or the client name of the requester whose connections to the shared resource will be listed Note The server computer name can be specified as '' for a local server. Example /* Get connection information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETCONNECTION = 40 SrvName = '\\DOMAIN_CONTRLR' Qualifier = '\\ITSCWK21' myRc = NetGetInfo(NETCONNECTION, 'connInfo', SrvName, Qualifier) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end if connInfo.0 = 0 then do say 'No connections established' call DropLsRxutFuncs exit 0 end if connInfo.num_entries <> 0 then do say "Number of entries: " connInfo.num_entries do i=1 to connInfo.num_entries say say "Connection id: " connInfo.i.id say "Connection type: " connInfo.i.type say "Connection num opens: " connInfo.i.num_opens say "Connection num users: " connInfo.i.num_users say "Connection time: " connInfo.i.time say "Connection user name: " connInfo.i.username say "Connection net name: " connInfo.i.netname end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 2 Connection id: 6145 Connection type: Interprocess Communication Connection Connection num opens: 0 Connection num users: 1 Connection time: 411 Connection user name: ADMIN04 Connection net name: IPC$ Connection id: 59393 Connection type: Disk Connection Connection num opens: 1 Connection num users: 1 Connection time: 367 Connection user name: ADMIN04 Connection net name: C$ ═══ 12.10. NETDASD Get Info (LS40) ═══ The function retrieves directory limits information for a particular directory resource. Before this function can be used successfully, directory limits must be enabled on the 386-HPFS drive. (See the NetMisc(NETDASDCONTROL) function) Syntax MyRc = NetGetInfo(NETDASD, 'DASDInfo', SrvName) Parameters The parameters required and returned are: 'DASDInfo' The directory limits information variable, which is divided into: DASDInfo.DirPath A string containing the directory path. The string must be directory path, beginning with the drive letter, and only ending with a backslash when a root directory is specified. If a redirected drive is specified for DASDInfo.DirPath, the SrvName parameter must be '' DASDInfo.resource_name The name of the directory having a directory limit. DASDInfo.max The amount of disk space allotted to this directory by directory limits. Specified in KB, this field can be set from 1 to 67108863. DASDInfo.use The amount (in KB) of disk space already occupied within the specified directory resource DASDInfo.thresh The initial alert threshold as a percentage of the total directory limit space allotted, with values ranging from 0 to 99. Zero specifies that no threshold alert is to be generated, and 99 specifies that an alert is generated when 99% of the allotted directory limit for this directory has been reached. DASDInfo.delta The increment in which alerts are to be generated after the DASDInfo.thresh threshold has been crossed, but before all of the allotted disk space has been used. SrvName The computer name of the server to enumerate the directory limits on Note The server computer name can be specified as '' for a local server. Example /* DASD directory limit get information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASD = 750 DASDInfo.DirPath = 'D:\APPS\DATA' SrvName = '\\DOMAIN_CONTRLR' myRc = NetGetInfo(NETDASD, 'DASDInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc exitRc = 9 end else do say 'Directory path ' DASDInfo.resource_name say 'Directory limit ' DASDInfo.max say 'Current Usage ' DASDInfo.use say 'Threshold ' DASDInfo.thresh say 'Delta ' DASDInfo.delta exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Directory path D:\APPS\DATA Directory limit 512 Current Usage 102 Threshold 90 Delta 5 ═══ 12.11. NETLOGON Get Info ═══ Retrieves information about logged-on users. Syntax MyRc = NetGetInfo(NETLOGON, 'logonInfo') MyRc = NetGetInfo(NETLOGON, 'logonInfo', SrvName) Parameters The NetGetInfo(NETLOGON) function has two different forms. The first form with no SrvName parameter is identical to the second form with the SrvName parameter value set to ''. The parameters specified are: 'logonInfo' The REXX variable receiving the result. The variable is divided into: logonInfo.num_entries The number of logon information entries. Each entry is obtained by the index i, which has a value from 1 to logonInfo.num_entries logonInfo.i.eff_name The name of the account to which the user was logged on logonInfo.i.computer The computer name logonInfo.i.full_name The fullname value specified in the user account logonInfo.i.usrcomment The user settable value for user comments logonInfo.i.logon_time The time and date when the user logged on SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* Get information on logged on users on this server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETLOGON = 50 SrvName = '\\FSCDC' myRc = NetGetInfo(NETLOGON, 'logonInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end if logonInfo.num_entries <> 0 then do say "Number of entries: " logonInfo.num_entries do i=1 to logonInfo.num_entries say say "Logon eff_name: " logonInfo.i.eff_name say "Logon computer: " logonInfo.i.computer say "Logon full name: " logonInfo.i.full_name say "Logon user comment: " logonInfo.i.usrcomment say "Logon time: " logonInfo.i.logon_time end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 1 Logon eff_name: LINDBERG Logon computer: FSC30DCR Logon full name: Ingolf Lindberg, OS/2 Competency Center Logon user comment: Ingolf Lindberg in N91-3161 Logon time: Tue May 4 07:44:26 1993 ═══ 12.12. NETFILE Get Info ═══ The function retrieves information about a particular opened file on a server. Syntax MyRc = NetGetInfo(NETFILE, 'fileInfo', SrvName, fileId) Parameters The parameters specified are: 'fileInfo' The REXX variable receiving the result. The variable is divided into: fileInfo.id The file identifier fileInfo.permissions The access permissions of the opening application. fileInfo.num_locks The number of file locks on the file, device, or pipe fileInfo.pathname The path name of the opened resource fileInfo.username The name of the userid that first opened the file SrvName The server computer name fileId The file identifier. This value must be supplied Note The server computer name can be specified as '' for a local server. Example /* Get opened file information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETFILE = 60 SrvName = '\\FSCDC' fileId = 167273 myRc = NetGetInfo(NETFILE, 'fileInfo', SrvName, fileId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "File id: " fileInfo.id say "File permissions: " fileInfo.permissions say "File number locks: " fileInfo.num_locks say "File path: " fileInfo.pathname say "File user name: " fileInfo.username call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output File id: 167273 File permissions: R File number locks: 0 File path: D:\BOOKS\GG243783.BOO File user name: FSCADMIN ═══ 12.13. NETFINDADDRESS ═══ The function performs a "NCB.FIND.NAME" and finds one or more LAN addresses from a specified NetBIOS name. Syntax MyRc = NetGetInfo(NETFINDADDRESS, addressList, NetbiosName, type2Find) Parameters The parameters specified are: addressList The REXX variable receiving the result. The variable is divided into: addressList.count The count of LAN addresses found addressList.i.address The adapter address of the adapter having the searched NetBIOS name registered. The variable i has a value from 1 to addressList.count addressList.i.route The routing information from the machine issuing the call to the adapter found. The variable i has a value from 1 to addressList.count NetBiosName The NetBIOS name to find type2Find The type of the NetBIOS name to find. OS/2 LAN Requester and OS/2 LAN Server encodes the NetBIOS names used in different formats. The following name type vaules can be used: Value What to find ----- ------------ 0 A NetBIOS name 1 A LAN Server/Requester 3.0 Message name or Userid 2 A LAN Server/Requester 3.0 Computer name 3 LAN Server/Requester 3.0 domain group name Notes The information obtained is formatted for Token-Ring networks. If the return code has a value, it is either a return code from a call to the NetBIOS submit interface or a NetBIOS Network Control Block return code. There is no guarantee that all nodes will respond within the NetBIOS interface timeout values specified on the executing workstation. Example /* Get adapter addresses of current connected workstations */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETFINDADDRESS = 410 NetbiosName = 'FSC' type2Find = 3 myRc = NetGetInfo(NETFINDADDRESS, addressList, NetbiosName, type2Find) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Count: ' addressList.count do i=1 to addressList.count say addressList.i.address say addressList.i.route say end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Count: 2 10005AF78491 -none- 4000100C1240 S504 B1 S50B B1 S501 ═══ 12.14. NETGROUP Get Info ═══ The function retrieves group related information. Syntax MyRc = NetGetInfo(NETGROUP, 'groupInfo', SrvName, GroupName) Parameters The parameters specified are: 'groupInfo' The REXX variable receiving the result. The variable is divided into: groupInfo.name The group name groupInfo.comment The group comment SrvName The server computer name GroupName The name of the group. This value must be supplied Note The server computer name can be specified as '' for a local server. Example /* Get group comment */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUP = 70 SrvName = '\\ILIDC' GroupName = 'CSUSERS' myRc = NetGetInfo(NETGROUP, 'groupInfo', SrvName, GroupName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "Group Name: " groupInfo.name say "Group Comment: " groupInfo.comment call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Group Name: CSUSERS Group Comment: The Client/Server users group ═══ 12.15. NETGROUPUSERS Get Info ═══ The function returns a list of members of a particular group. Syntax MyRc = NetGetInfo(NETGROUPUSERS, 'groupInfo', SrvName, GroupName) Parameters The parameters specified are: 'groupInfo' The REXX variable receiving the result. The variable is divided into: groupInfo.0 Counts the number of user accounts defined in the group groupInfo.i The user account number i defined in the group. The variable i has a value from 1 to groupInfo.0 SrvName The computer name of the domain controller GroupName The group name. The group name must be supplied Note The server computer name can be specified as '' for a local domain controller. Example /* Get group users */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETGROUPUSERS = 340 SrvName = '\\ILIDC' GroupName = 'CSUSERS' myRc = NetGetInfo(NETGROUPUSERS, 'groupInfo', SrvName, GroupName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say do i=1 to groupInfo.0 say "UserId: " groupInfo.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output UserId: LINDBERG UserId: BRUGERID UserId: USERID ═══ 12.16. NETLOGONASN Get Info ═══ The function retrieves information about logon assignments for a specified userid. Syntax MyRc = NetGetInfo(NETLOGONASN, 'logonAsnInfo', SrvName, UserId) Parameters The parameters specified are: 'logonAsnInfo' The REXX variable receiving the result. The variable is divided into: logonAsnInfo.count The count of logon assignments. If this value is equal or large than 1 then the following values are assigned: logonAsnInfo.i.alias The alias name assigned. The variable i has a value from 1 to logonAsnInfo.count logonAsnInfo.i.type The alias type. The variable i has a value from 1 to logonAsnInfo.count logonAsnInfo.i.device The local device. The variable i has a value from 1 to logonAsnInfo.count SrvName The server computer name of the domain controller UserId The userid Note The server computer name can be specified as '' for a local domain controller. Example /* Get the user logon assignments information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETLOGONASN = 52 SrvName = '\\ILIDC' UserId = 'FMAM' myRc = NetGetInfo(NETLOGONASN, 'logonAsnInfo', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end if logonAsnInfo.count = 0 then do say 'No logon assignments' call DropLsRxutFuncs exit 0 end say 'The number of logon assignments are: ' logonAsnInfo.count do i=1 to logonAsnInfo.count say say 'The Alias assigned: ' logonAsnInfo.i.alias say 'Alias type: ' logonAsnInfo.i.type say 'Device assigned: ' logonAsnInfo.i.device end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output The number of logon assignments are: 3 The Alias assigned: BOOKS Alias type: Files alias Device assigned: O The Alias assigned: MYDEMO Alias type: Files alias Device assigned: P The Alias assigned: SRVCOM Alias type: Serial device alias Device assigned: COM3 ═══ 12.17. NETMESSAGENAME Get Info ═══ The function retrieves information about a userid entry in the message name table. Syntax MyRc = NetGetInfo(NETMESSAGENAME, 'msgNameInfo', SrvName, MsgName) Parameters The parameters specified are: 'msgNameInfo' The REXX variable receiving the result. The variable is divided into: msgNameInfo.name The messaging name msgNameInfo.forward_flag The value specifies whether messages will be sent to a user or application on the local computer, or forwarded to a user or application on a remote computer msgNameInfo.forward The value will specify the user name to which the message will be sent, if messages are to be forwarded SrvName The server or requester computer name MsgName The message name Note The server or requester computer name can be specified as '' for a local server or computer. Example /* Get message name information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAME = 80 SrvName = '\\ILIDC' MsgName = 'LINDBERG' myRc = NetGetInfo(NETMESSAGENAME, 'msgNameInfo', SrvName, MsgName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "Message Name: " msgNameInfo.name say "Forward flag: " msgNameInfo.forward_flag say "Forward to: " msgNameInfo.forward call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Message Name: LINDBERG Forward flag: Not forwarded Forward to: N/A ═══ 12.18. NETMESSAGELOGFILE Get Info ═══ The function retrieves the name of the message log file and the current logging status (on or off). Syntax MyRc = NetGetInfo(NETMESSAGELOGFILE, 'msgLogFileInfo', SrvName) Parameters The parameters specified are: 'msgLogFileInfo' The REXX variable receiving the result. The variable is divided into: msgLogFileInfo.filename A string containing the complete path and file name, beginning with the drive letter of the message log file msgLogFileInfo.logswitch A integer specifying whether logging is enabled. If 0, message logging is disabled; otherwise, message logging is enabled SrvName The server computer name Note The server computer name can be specified as '' for a local server or computer. Example /* Get the message log file and logging state */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGELOGFILE = 550 SrvName = '\\ANYSRV01' myRc = NetGetInfo(NETMESSAGELOGFILE, 'msgLogFileInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc exitRc = 9 end else do say 'Message log file information' say say 'State ' msgLogFileInfo.logswitch say 'File ' msgLogFileInfo.filename end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output State 0 File C:\IBMLAN\LOGS\MESSAGES.LOG ═══ 12.19. NETPRINTDEST Get Info ═══ The function returns information about a particular printer destination. Syntax MyRc = NetGetInfo(NETPRINTDEST, 'prtDestInfo', SrvName, DevName) Parameters The parameters specified are: 'prtDestInfo' The REXX variable receiving the result. The variable is divided into: prtDestInfo.PrinterName The printer device name prtDestInfo.UserName The user that submitted the current job, if a job is printing. If a local job is printing the value 'Local User' is used. If no jobs are printing the value of '-none-' is used prtDestInfo.LogAddr The printer logical address (LPT1 for example) prtDestInfo.JobId The current printing job id. If the returned value is 0, no jobs are printing prtDestInfo.Status The printer device status prtDestInfo.StatusComment Print device comment while printing prtDestInfo.Comment Print device description prtDestInfo.Drivers Print driver supported by this device prtDestInfo.time Time (in minutes) current print job has been printing prtDestInfo.TimeOut Print device Time Out (in seconds) SrvName The server computer name DevName The printer device name Note The server computer name can be specified as '' for a local server or computer. Example /* Get Print destination information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTDEST = 100 SrvName = '\\FSC30DCR' DevName = 'IBM40191' myRc = NetGetInfo(NETPRINTDEST, 'prtDestInfo', SrvName, DevName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Printer device name: ' prtDestInfo.PrinterName say 'Current user job printing: ' prtDestInfo.UserName say 'Printer logical address: ' prtDestInfo.LogAddr say 'Current job id printing: ' prtDestInfo.JobId say 'Print device status: ' prtDestInfo.Status say 'Job Comment: ' prtDestInfo.StatusComment say 'Device describtion: ' prtDestInfo.Comment say 'Supported drivers: ' prtDestInfo.Drivers say 'Time current job printing: ' prtDestInfo.time say 'Print device timeout: ' prtDestInfo.TimeOut call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Printer device name: IBM40191 Current user job printing: -none- Printer logical address: LPT3 Current job id printing: 0 Print device status: Processing Job Comment: -none- Device describtion: IBM 4019 LaserPrinter Supported drivers: IBM4019.IBM 4019 LaserPrinter Time current job printing: -none- Print device timeout: 45 ═══ 12.20. NETPRINTJOB Get Info ═══ The function returns information about a print job. Syntax MyRc = NetGetInfo(NETPRINTJOB, 'prtJobInfo', SrvName, QueueName, PrtJobId) Parameters The parameters specified are: 'prtJobInfo' The REXX variable receiving the result. The variable is divided into: prtJobInfo.JobId The print job identifier prtJobInfo.Priority The print job priority prtJobInfo.UserName The userid of the job submitting the job prtJobInfo.Position The job position in the print queue prtJobInfo.Status The status of the print job prtJobInfo.Submitted The time when the job was submitted prtJobInfo.Size The print job size prtJobInfo.Comment The print job comment prtJobInfo.Document The document name prtJobInfo.NotifyName Messaging alias for print alert prtJobInfo.DataType The data type of the submitted file prtJobInfo.Parms The parameters related to the print job prtJobInfo.StatusComment The status comment prtJobInfo.Queue The queue name prtJobInfo.QProcName The queue processor name prtJobInfo.QProcParms The queue processor parameters prtJobInfo.PrinterName The printer name prtJobInfo.Version The printer driver version prtJobInfo.DeviceName The device name SrvName The server computer name QueueName The Queue name PrtJobId The Printer Job Id Note The server computer name can be specified as '' for a local server or computer. Example /* Get Print job information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTJOB = 110 SrvName = '\\FSC30DCR' QueueName = 'IBM4019L' PrtJobId = 5 myRc = NetGetInfo(NETPRINTJOB, 'prtJobInfo', SrvName, QueueName, PrtJobId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Job id: ' prtJobInfo.JobId say 'Job priority: ' prtJobInfo.Priority say 'Userid who submitted job: ' prtJobInfo.UserName say 'Job position in Queue: ' prtJobInfo.Position say 'Job status: ' prtJobInfo.Status say 'Submitted at: ' prtJobInfo.Submitted say 'Job size: ' prtJobInfo.Size say 'Job comment: ' prtJobInfo.Comment say 'Document name: ' prtJobInfo.Document say 'Notify: ' prtJobInfo.NotifyName say 'Data type: ' prtJobInfo.DataType say 'Job parameters: ' prtJobInfo.Parms say 'Job status comment: ' prtJobInfo.StatusComment say 'Queue name: ' prtJobInfo.Queue say 'Queue processor: ' prtJobInfo.QProcName say 'Queue processor parameters: ' prtJobInfo.QProcParms say 'The printer name: ' prtJobInfo.PrinterName say 'Printer Driver version: ' prtJobInfo.Version say 'Device Name: ' prtJobInfo.DeviceName call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Job id: 5 Job priority: 50 Userid who submitted job: Job position in Queue: Next Job status: Queued Submitted at: Wed May 5 19:45:06 1993 Job size: 109320 Job comment: System Document name: LS30BAS2.C Notify: Data type: PM_Q_RAW Job parameters: Job status comment: Queue name: IBM4019L Queue processor: PMPRINT Queue processor parameters: CDP=850 The printer name: Printer Driver version: 777 Device Name: IBM 4019 LaserPrinter ═══ 12.21. NETPRINTQUEUE Get Info ═══ The function returns information about a print queue. Syntax MyRc = NetGetInfo(NETPRINTQUEUE, 'prtQInfo', SrvName, QueueName) Parameters The parameters specified are 'prtQInfo' The REXX variable receiving the result. The variable is divided into: prtQInfo.Priority The queue priority prtQInfo.StartTime The queue start time prtQInfo.UntilTime The queue until time prtQInfo.Type The queue type. A hexadecimal value, which is not interpreted prtQInfo.SepFile The queue separator file if any prtQInfo.PrProc The queue default queue processor prtQInfo.Parms The queue parameters prtQInfo.Comment The queue comment or description prtQInfo.Status The queue status. A hexadecimal value, which is not interpreted prtQInfo.Jobs The number of jobs in the queue prtQInfo.Printers The print device connected to the queue prtQInfo.DriverName The default print driver prtQInfo.RemoteComputerName The remote computer name prtQInfo.RemoteQueueName The remote queue name prtQInfo.Version The printer driver version prtQInfo.DeviceName The device name SrvName The server computer name QueueName The Queue name Note The server computer name can be specified as '' for a local server or computer. Example /* Get Print queue information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETPRINTQUEUE = 120 SrvName = '\\FSC30DCR' QueueName = 'IBM4019L' myRc = NetGetInfo(NETPRINTQUEUE, 'prtQInfo', SrvName, QueueName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Queue Priority: ' prtQInfo.Priority say 'Queue start time: ' prtQInfo.StartTime say 'Queue until time: ' prtQInfo.UntilTime say 'Queue type: ' prtQInfo.Type say 'Separator File: ' prtQInfo.SepFile say 'Default Queue processor: ' prtQInfo.PrProc say 'Queue parameters: ' prtQInfo.Parms say 'Queue description: ' prtQInfo.Comment say 'Queue status: ' prtQInfo.Status say 'Number of jobs in queue: ' prtQInfo.Jobs say 'Printer connected: ' prtQInfo.Printers say 'Default printer driver: ' prtQInfo.DriverName say 'Computer Name at location: ' prtQInfo.RemoteComputerName say 'Queue name at location: ' prtQInfo.RemoteQueueName say 'Printer Driver version: ' prtQInfo.Version say 'Device Name: ' prtQInfo.DeviceName call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Queue Priority: 5 Queue start time: No Restriction Queue until time: No Restriction Queue type: 0002 Separator File: Default Queue processor: PMPRINT Queue parameters: Queue description: IBM 4019 LaserPrinter Queue status: 0001 Number of jobs in queue: 0 Printer connected: IBM40191 Default printer driver: IBM4019.IBM 4019 LaserPrinter Computer Name at location: Queue name at location: Printer Driver version: 777 Device Name: IBM 4019 LaserPrinter ═══ 12.22. NETSERVER Get Info ═══ The function retrieves information about a particular server. Syntax MyRc = NetGetInfo(NETSERVER, 'serverInfo', SrvName) Parameters The parameters specified are: 'serverInfo' The REXX variable receiving the result. The variable is divided into: serverInfo.name The server computer name serverInfo.version_major The major version number (Version) serverInfo.version_minor The minor version number (Release) serverInfo.type The server type. This information is a hexadecimal value and is not interpreted serverInfo.comment The server comment serverInfo.ulist_mtime The last time the users list was modified serverInfo.glist_mtime The last time the group list was modified serverInfo.alist_mtime The last time the access control list was modified serverInfo.users The maximum of users on the server serverInfo.disc The auto-disconnet value serverInfo.alerts The server alerts receiver table. The table can be empty serverInfo.security The security type of the server serverInfo.auditing The auditing setting serverInfo.numadmin The maximum allowed number of administrators serverInfo.lanmask The order in which the network device drivers are served. The value is uninterpreted serverInfo.hidden The server hidden attribute setting serverInfo.announce The network announce delta (in seconds), which determines how often the server will be announced to other computers on the network serverInfo.anndelta The random announce rate (in milliseconds) serverInfo.guestacct The guest account name serverInfo.userpath The path name to user directories serverInfo.chdevs The number of serial devices that can be shared on the server serverInfo.chdevq The number of serial device queues that can coexist on the server serverInfo.chdevjobs The number of serial device jobs that can be pending on a server serverInfo.connections The maximum number of connections to netnames that are allowed serverInfo.shares The maximum number of netnames a server can accommodate serverInfo.openfiles The number of files (file handles to for example files or pipes) that can be opened at once serverInfo.sessopens The number of files that can be opened in one session serverInfo.sessvcs The maximum number of virtual circuits per client serverInfo.sessreqs The number of simultaneous requests that a client can make on any virtual circuit serverInfo.opensearch The number of searches that can be opened at once serverInfo.activelocks The number of file locks that can be active serverInfo.numreqbuf The number of server buffers that are provided serverInfo.sizreqbuf The size (in bytes) of each server buffer serverInfo.numbigbuf Number of 64KB server buffers that are provided serverInfo.numfiletasks Number of processes that can access the operating system at one time serverInfo.alertsched The alert interval for notifying an administrator of a network event serverInfo.erroralert The number of entries that can be written to the error log file during a interval before notifying an administrator serverInfo.logonalert The number of failed logon attempts to allow a user before notifying an administrator serverInfo.accessalert The number of failed file accesses to allow before issuing an administrative alert serverInfo.diskalert The number of kilobytes of free disk space, at which, an administrator must be notified that the free space is low serverInfo.netioalert The Network I/O error ratio in one tenth of a percent to allow before the administrator is notified serverInfo.maxauditsz Maximum audit file size serverInfo.srvheuristics The server heuristics settings serverInfo.auditedevents The audit events setting. This value is unformatted and is presented hexadecimal serverInfo.autoprofile The server auto profile setting serverInfo.autopath The server autoprofile location SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* Get server information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVER = 160 SrvName = '\\ILIDC' myRc = NetGetInfo(NETSERVER, 'serverInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Server name: ' serverInfo.name say 'Major version (Version): ' serverInfo.version_major say 'Minor version (Release): ' serverInfo.version_minor say 'Server type: ' serverInfo.type say 'Comment: ' serverInfo.comment say 'Users list last changed: ' serverInfo.ulist_mtime say 'Group list last changed: ' serverInfo.glist_mtime say 'Access Control list last changed: ' serverInfo.alist_mtime say 'Maximum number of users: ' serverInfo.users say 'Auto-disconnect value: ' serverInfo.disc say 'Send server alerts to: ' serverInfo.alerts say 'Server security type: ' serverInfo.security say 'Auditing setting: ' serverInfo.auditing say 'Maximum number administrators: ' serverInfo.numadmin say 'LAN mask setting: ' serverInfo.lanmask say 'Server hidden attribute setting: ' serverInfo.hidden say 'Server network announce: ' serverInfo.announce say 'Random announce rate delta: ' serverInfo.anndelta say 'Guest account name: ' serverInfo.guestacct say 'Path to user directories: ' serverInfo.userpath say 'Maximum shared serial devices: ' serverInfo.chdevs say 'Maximum serial device queues: ' serverInfo.chdevq say 'Maximum pending serial jobs: ' serverInfo.chdevjobs say 'Maximum connections: ' serverInfo.connections say 'Maximum shares: ' serverInfo.shares say 'Maximum open file handles: ' serverInfo.openfiles say 'Maximum session opens: ' serverInfo.sessopens say 'Per Client maximum virtual circuits: ' serverInfo.sessvcs say 'Maximum requests: ' serverInfo.sessreqs say 'Maximum searches: ' serverInfo.opensearch say 'Maximum locks: ' serverInfo.activelocks say 'Number requester buffers: ' serverInfo.numreqbuf say 'Requester buffer size: ' serverInfo.sizreqbuf say 'Number big buffers: ' serverInfo.numbigbuf say 'Number file tasks: ' serverInfo.numfiletasks say 'alertsched value: ' serverInfo.alertsched say 'erroralert value: ' serverInfo.erroralert say 'logonalert value: ' serverInfo.logonalert say 'accessalert value: ' serverInfo.accessalert say 'diskalert value: ' serverInfo.diskalert say 'Maximum auditing log file size: ' serverInfo.maxauditsz say 'srvheuristics: ' serverInfo.srvheuristics say 'Audit events flags: ' serverInfo.auditedevents say 'Server auto profile setting: ' serverInfo.autoprofile say 'Server autoprofile location: ' serverInfo.autopath call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Server name: ILIDC Major version (Version): 3 Minor version (Release): 0 Server type: 0000002B Comment: ILI netvork group Domain Controller Users list last changed: Never modified or unknown Group list last changed: Never modified or unknown Access Control list last changed: Wed May 5 18:30:24 1993 Maximum number of users: 32 Auto-disconnect value: 120 Send server alerts to: -none- Server security type: User-level Auditing setting: Disabled Maximum number administrators: 65535 LAN mask setting: 1 Server hidden attribute setting: Visible Server network announce: 60 Random announce rate delta: 3000 Guest account name: GUEST Path to user directories: -none- Maximum shared serial devices: 2 Maximum serial device queues: 2 Maximum pending serial jobs: 6 Maximum connections: 128 Maximum shares: 24 Maximum open file handles: 250 Maximum session opens: 80 Per Client maximum virtual circuits: 1 Maximum requests: 50 Maximum searches: 50 Maximum locks: 64 Number requester buffers: 36 Requester buffer size: 4096 Number big buffers: 12 Number file tasks: 1 alertsched value: 5 erroralert value: 5 logonalert value: 5 accessalert value: 5 diskalert value: 5000 Maximum auditing log file size: 100 srvheuristics: 11110141111311001331 Audit events flags: 0 Server auto profile setting: Unknown Server autoprofile location: SRVAUTO.PRO ═══ 12.23. NETSERVERMODALS Get Info ═══ The function gets server modals related information. Syntax MyRc = NetGetInfo(NETSERVERMODALS, 'serverModalsInfo', SrvName) Parameters The parameters specified are: 'serverModalsInfo' The REXX variable receiving the result. The variable is divided into: serModalsInfo.role The server role. The following will be returned: String returned --------------- Standalone server Member server in the domain Backup server in the domain Primary server in the domain serModalsInfo.primary The name of the primary domain controller to which the server belongs SrvName The server computer name. Note The server computer name can be specified as '' for a local server. Example /* Get server modals information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVERMODALS = 370 SrvName = '\\ILIDC' myRc = NetGetInfo(NETSERVERMODALS, 'serverModalsInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Server role: ' serverModalsInfo.role say 'Domain Controller name: ' serverModalsInfo.primary call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Server role: Primary server in the domain Domain Controller name: ILIDC ═══ 12.24. NETSERVICE Get Info ═══ The function retrieves information about a particular network service that is started. Syntax MyRc = NetGetInfo(NETSERVICE, 'serviceInfo', SrvName, ServiceName) Parameters The parameters specified are: 'serviceInfo' The REXX variable receiving the result. The variable is divided into: serviceInfo.name The service name serviceInfo.status The service status. This is a uninterpreted hexadecimal value serviceInfo.code The error codes when a service stops or fails to start properly. The values are a primary and secondary code serviceInfo.pid The service process id serviceInfo.text The service text SrvName The server computer name ServiceName The service name Note The server computer name can be specified as '' for a local server. Example /* Get service information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVICE = 170 SrvName = '\\FSC30DCR' ServiceName = 'ALERTER' myRc = NetGetInfo(NETSERVICE, 'serviceInfo', SrvName, ServiceName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'The service name: ' serviceInfo.name say 'Service status: ' serviceInfo.status say 'Service code: ' serviceInfo.code say 'Process id: ' serviceInfo.pid say 'Service text: ' serviceInfo.text call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output The service name: ALERTER Service status: 13 Service code: 0 Process id: 67 Service text: -none- ═══ 12.25. NETSESSION Get Info ═══ The function retrieves information about a particular session. Syntax MyRc = NetGetInfo(NETSESSION, 'sessionInfo', SrvName, ComputerName) Parameters The parameters specified are: 'sessionInfo' The REXX variable receiving the result. The variable is divided into: sessionInfo.cname The computer name sessionInfo.username The user name (Userid) sessionInfo.num_conns The number of connections that have been made during the session sessionInfo.num_opens The number of opens that have been made during the session sessionInfo.num_users The number of sessions that are established between the server and req sessionInfo.time The number of seconds a session has been active sessionInfo.idle_time The number of seconds a session has been idle sessionInfo.user_flags The user flags sessionInfo.cltype_name Set the name of the client types SrvName The server computer name ComputerName The computer name Note The server computer name can be specified as '' for a local server. Example /* Get session information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSESSION = 180 SrvName = '\\FSCDC' ComputerName = '\\FSC30DCR' myRc = NetGetInfo(NETSESSION, 'sessionInfo', SrvName, ComputerName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'The computer name: ' sessionInfo.cname say 'Userid: ' sessionInfo.username say 'Connections made: ' sessionInfo.num_conns say 'Number opens: ' sessionInfo.num_opens say 'Sessions established: ' sessionInfo.num_users say 'Session time: ' sessionInfo.time say 'Idle time: ' sessionInfo.idle_time say 'User flags: ' sessionInfo.user_flags say 'Client type: ' sessionInfo.cltype_name call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output The computer name: FSC30DCR Userid: FSCADMIN Connections made: 3 Number opens: 1 Sessions established: 1 Session time: 176 Idle time: 0 User flags: Unknown Client type: OS/2 LS 1.2 ═══ 12.26. NETSHARE Get Info ═══ The function retrieves information about a particular shared resource on a server. Syntax MyRc = NetGetInfo(NETSHARE, 'shareInfo', SrvName, NetworkName) Parameters The parameters specified are: 'shareInfo' The REXX variable receiving the result. The variable is divided into: shareInfo.netname The network name of the resource shareInfo.type The share type (For example Serial Device) shareInfo.remark The share remark shareInfo.permissions The shareInfo.permissions is used only for DLS and DLR applications and ignored for OS/2 applications. The meaning of this field depends on which type of resource is in query. If shareInfo.type is "Disk Drive", this field can be any combination of the following permissions, except for ACCESS_READ + ACCESS_CREATE. These are defined as follows: Value Meaning ----- ------- 1 Permission to read data from a resource. 2 Permission to write data to a resource. 4 Permission to create an instance of the resource (such as a file). Data can be written to the resource as the resource is created. If shareInfo.type is "Spooler Queue", the shareInfo.permissions parameter specifies the form control at the end of a print job. These are defined as follows: Value Meaning ----- ------- 2 The printer will not be sent a command at the end of any print job to position to the top of the page. 4 An attempt is made to determine whether a form feed is needed for a print job. If the last 64 bytes of the file contain no form feed command or follow a form feed command with printable characters, a form feed command is issued to the printer. 32 A form feed command is issued to the printer at the end of each print job to position to the top of the next form (default). Note: DLS and DLR does not support sharing of serial devices. In some circumstances, however, COM devices, such as COM1, can be shared as print devices; for example, if operating in synchronous communication mode, such as with a serial printer shareInfo.max_uses The maximum number of concurrent connections that the shared resource can accommodate shareInfo.current_uses The number of connections that are currently made to the resource shareInfo.path The local path name of the shared resource. For disks, it is the path being shared. For spooler queues, it is the name of the spooler queue being shared. For serial device queues, it is a string of one or more communication device names separated by spaces (For example, COM1 COM2) SrvName The server computer name NetName The network name Note The server computer name can be specified as '' for a local server. Example /* Get share information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARE = 190 SrvName = '\\FSC30DCR' NetworkName = 'FORALL' myRc = NetGetInfo(NETSHARE, 'shareInfo', SrvName, NetworkName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Network name: ' shareInfo.netname say 'Share type: ' shareInfo.type say 'Comment: ' shareInfo.remark say 'Maximum uses: ' shareInfo.max_uses say 'Current uses: ' shareInfo.current_uses say 'Local resource path: ' shareInfo.path call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Network name: FORALL Share type: Disk Drive Comment: For all users Maximum uses: 45 Current uses: 1 Local resource path: D:\APPS\BOOKS ═══ 12.27. NETSHARECHECK Get Info ═══ The function retrieves information about a particular shared resource on a server. Syntax MyRc = NetGetInfo(NETSHARECHECK, 'checkInfo', SrvName) Parameters The parameters specified are: 'checkInfo' The REXX variable required and receiving the result. The variable is divided into: shareInfo.devicename The device name to query shareInfo.type The returned share type, if the device is shared SrvName The server computer name Note The server computer name can be specified as '' for a local server. Example /* Net share check */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSHARECHECK = 210 ComputerName = '\\KING_BALU' checkInfo.devicename = 'Q:' myRc = NetGetInfo(NETSHARECHECK, 'checkInfo', ComputerName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc rcCode = 9 end else do say "Share type" checkInfo.type rcCode = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode exit 0 Example Output Share type Disk Drive ═══ 12.28. NETSTATISTICS ═══ The function retrieves operating statistics for a service. Syntax MyRc = NetGetInfo(NETSTATISTICS, 'statisticsInfo', ComputerName) MyRc = NetGetInfo(NETSTATISTICS, 'statisticsInfo', ComputerName, StatType) MyRc = NetGetInfo(NETSTATISTICS, 'statisticsInfo', ComputerName, StatType, ClearIt) Parameters The parameters specified are 'statisticsInfo' The REXX variable receiving the result. The variable is divided into two ways depending of the StatType parameter. If StatType = 0 then the requester statistics are provided. If StatType = 1 then the server statistics are provided. The returned values for requester statistics are: statisticsInfo.start The time that statistics collection started or the date or time that the statistics were last cleared statisticsInfo.numNCB_r The number of NCBs issued (redirector) statisticsInfo.numNCB_s The number of NCBs issued (server) statisticsInfo.numNCB_a The number of NCBs issued (application) statisticsInfo.fiNCB_r The number of NCBs that failed issue (redirector) statisticsInfo.fiNCB_s The number of NCBs that failed issue (server) statisticsInfo.fiNCB_a The number of NCBs that failed issue (application) statisticsInfo.fcNCB_r The number of NCBs that failed completion (redirector) statisticsInfo.fcNCB_s The number of NCBs that failed completion (server) statisticsInfo.fcNCB_a The number of NCBs that failed completion (application) statisticsInfo.sesstart The number of requester sessions started statisticsInfo.sessfailcon The number of requester session failures to connect statisticsInfo.sessbroke The number of failures of requester sessions statisticsInfo.uses The number of requester uses statisticsInfo.usefail The number of requester use failures statisticsInfo.autorec The number of requester autoconnects statisticsInfo.bytessent_r The number of requester bytes sent to the network. The representation will be floating point if the bytes send exceeds 0xFFFFFFFF statisticsInfo.bytesrcvd_r The number of requester bytes received from the network. The representation will be floating point if the bytes received exceeds 0xFFFFFFFF statisticsInfo.bytessent_s The number of server bytes sent to the network. The representation will be floating point if the bytes send exceeds 0xFFFFFFFF statisticsInfo.bytesrcvd_s The number of server bytes received from the network. The representation will be floating point if the bytes received exceeds 0xFFFFFFFF statisticsInfo.bytessent_a The number of application bytes sent to the network. The representation will be floating point if the bytes send exceeds 0xFFFFFFFF statisticsInfo.bytesrcvd_a The number of application bytes received from the network. The representation will be floating point if the bytes received exceeds 0xFFFFFFFF statisticsInfo.reqbufneed The number of times the requester required a request buffer but failed statisticsInfo.bigbufneed The number of times the requester required a big buffer but failed The returned values for server statistics are: statisticsInfo.start The time that statistics collection started or the date or time that the statistics were last cleared statisticsInfo.fopens The number of server file opens. This includes opens of named pipes statisticsInfo.devopens The number of server device opens statisticsInfo.jobsqueued The number of server print jobs spooled statisticsInfo.sopens The number of server session starts statisticsInfo.stimedout The number of server session autodisconnects statisticsInfo.serrorout The number of server sessions errored out statisticsInfo.pwerrors The number of server password violations statisticsInfo.permerrors The number of server access permission errors statisticsInfo.syserrors The number of server system errors statisticsInfo.bytessent The number of server bytes sent to the network. The representation will be floating point if the bytes send exceeds 0xFFFFFFFF statisticsInfo.bytesrcvd The number of server bytes received from the network. The representation will be floating point if the bytes received exceeds 0xFFFFFFFF statisticsInfo.avresponse The average server response time in milliseconds statisticsInfo.reqbufneed The number of times the server required a request buffer but failed statisticsInfo.bigbufneed The number of times the server required a big buffer but failed ComputerName The server computer name StatType Using value 0 gives requester statistics. A value 1 gives server statistics ClearIt Using value 1 clears the statistics, otherwise no clear is done. A call to NetGetInfo(NETSTATISTICS) with 4 parameters, no clear will be done A call to NetGetInfo(NETSTATISTICS) with 3 parameters, no clear and a call to retrieve requester information will be done Note The server computer name can be specified as '' for a local server or computer. Example /* Get statistics information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs SrvName = '\\FSC30DCR' NETSTATISTICS = 195 REQ_STAT = 0 SRV_STAT = 1 /* Get the requester statistics */ myRc = NetGetInfo(NETSTATISTICS, 'statisticsInfo', SrvName, REQ_STAT, 10) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "Statistics req start: " statisticsInfo.start say "Statistics req numNCB_r: " statisticsInfo.numNCB_r say "Net Statistics numNCB_s: " statisticsInfo.numNCB_s say "Net Statistics numNCB_a: " statisticsInfo.numNCB_a say "Net Statistics fiNCB_r: " statisticsInfo.fiNCB_r say "Net Statistics fiNCB_s: " statisticsInfo.fiNCB_s say "Net Statistics fiNCB_a: " statisticsInfo.fiNCB_a say "Net Statistics fcNCB_r: " statisticsInfo.fcNCB_r say "Net Statistics fcNCB_s: " statisticsInfo.fcNCB_s say "Net Statistics fcNCB_a: " statisticsInfo.fcNCB_a say "Net Statistics sesstart: " statisticsInfo.sesstart say "Net Statistics sessfailcon: " statisticsInfo.sessfailcon say "Net Statistics sessbroke: " statisticsInfo.sessbroke say "Net Statistics uses: " statisticsInfo.uses say "Net Statistics usefail: " statisticsInfo.usefail say "Net Statistics autorec: " statisticsInfo.autorec say "Net Statistics bytessent_r: " statisticsInfo.bytessent_r say "Net Statistics bytesrcvd_r: " statisticsInfo.bytesrcvd_r say "Net Statistics bytessent_s: " statisticsInfo.bytessent_s say "Net Statistics bytesrcvd_s: " statisticsInfo.bytesrcvd_s say "Net Statistics bytessent_a: " statisticsInfo.bytessent_a say "Net Statistics bytesrcvd_a: " statisticsInfo.bytesrcvd_a say "Net Statistics reqbufneed: " statisticsInfo.reqbufneed say "Net Statistics bigbufneed: " statisticsInfo.bigbufneed /* The server statistics */ myRc = NetGetInfo(NETSTATISTICS, 'statisticsInfo', SrvName, SRV_STAT, 10) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say "Statistics srv start: " statisticsInfo.start say "Statistics srv fopens: " statisticsInfo.fopens say "Statistics srv devopens: " statisticsInfo.devopens say "Statistics srv jobsqueued: " statisticsInfo.jobsqueued say "Statistics srv sopens: " statisticsInfo.sopens say "Statistics srv stimedout: " statisticsInfo.stimedout say "Statistics srv serrorout: " statisticsInfo.serrorout say "Statistics srv pwerrors: " statisticsInfo.pwerrors say "Statistics srv permerrors: " statisticsInfo.permerrors say "Statistics srv syserrors: " statisticsInfo.syserrors say "Statistics srv bytessent: " statisticsInfo.bytessent say "Statistics srv bytesrcvd: " statisticsInfo.bytesrcvd say "Statistics srv avresponse: " statisticsInfo.avresponse say "Statistics srv reqbufneed: " statisticsInfo.reqbufneed say "Statistics srv bigbufneed: " statisticsInfo.bigbufneed call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Statistics req start: Thu May 6 18:19:15 1993 Statistics req numNCB_r: 2213 Net Statistics numNCB_s: 31 Net Statistics numNCB_a: 1410 Net Statistics fiNCB_r: 0 Net Statistics fiNCB_s: 0 Net Statistics fiNCB_a: 0 Net Statistics fcNCB_r: 0 Net Statistics fcNCB_s: 0 Net Statistics fcNCB_a: 0 Net Statistics sesstart: 7 Net Statistics sessfailcon: 0 Net Statistics sessbroke: 3 Net Statistics uses: 23 Net Statistics usefail: 0 Net Statistics autorec: 0 Net Statistics bytessent_r: 2430724 Net Statistics bytesrcvd_r: 263720 Net Statistics bytessent_s: 320 Net Statistics bytesrcvd_s: 1019 Net Statistics bytessent_a: 73113 Net Statistics bytesrcvd_a: 90194 Net Statistics reqbufneed: 0 Net Statistics bigbufneed: 0 Statistics srv start: Thu May 6 20:19:21 1993 Statistics srv fopens: 0 Statistics srv devopens: 0 Statistics srv jobsqueued: 0 Statistics srv sopens: 2 Statistics srv stimedout: 0 Statistics srv serrorout: 0 Statistics srv pwerrors: 0 Statistics srv permerrors: 0 Statistics srv syserrors: 0 Statistics srv bytessent: 160 Statistics srv bytesrcvd: 5121 Statistics srv avresponse: 157 Statistics srv reqbufneed: 0 Statistics srv bigbufneed: 0 ═══ 12.29. NETUSE Get Info ═══ The function retrieves information about a connection to a shared resource. Syntax MyRc = NetGetInfo(NETUSE, 'useInfo', SrvName, NetworkName) Parameters The parameters specified are: 'useInfo' The REXX variable receiving the result. The variable is divided into: useInfo.local The local device name being redirected to the shared resource useInfo.remote The UNC name of the remote resource being accessed The string has the following form \\servername\netname useInfo.password This value is not available (N/A) useInfo.status The status of the connection useInfo.asg_type The resource type useInfo.refcount The number of files, directories, and other processes that are open on the remote resource useInfo.usecount The number of uses SrvName The server computer name NetworkName The network name If the connection is a device name connection, then the name specified must be the name of the local device If the connection is a UNC connection, then the name specified must be the UNC name Note The server computer name can be specified as '' for a local server or computer. Example /* Get net use information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSE = 270 SrvName = '\\FSC30DCR' NetworkName = 'T:' myRc = NetGetInfo(NETUSE, 'useInfo', SrvName, NetworkName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Local device name: ' useInfo.local say 'UNC name: ' useInfo.remote say 'Password: ' useInfo.password say 'Connection status: ' useInfo.status say 'Resource type: ' useInfo.asg_type say 'Open count: ' useInfo.refcount say 'Number uses: ' useInfo.usecount call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Local device name: T: UNC name: \\FSC30DCR\FORALL Password: N/A Connection status: Connection valid Resource type: Disk device Open count: 1 Number uses: 1 ═══ 12.30. NETUSER Get Info ═══ 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: userInfo.name The user account name userInfo.password_age The password age in seconds userInfo.priv The user account privilege level. The following values are returned: Account type Value ------------ ----- Guest 'Guest' User 'User' Administrator 'Admin' userInfo.home_dir The user home directory, if one is specified userInfo.comment The user account comment userInfo.flags User account flags. See below for the numeric values returned: Manifest Value Meaning -------- ----- -------------------------------------- SCRIPT 1 Must be 1. Logon script enabled ACCOUNTDISABLE 2 If 2, user's account disabled DELETE_PROHIBITED 4 If 4, user's account cannot be deleted HOMEDIR_REQUIRED 8 If 8, home directory required PASSWD_NOTREQD 32 If 32, password not required PASSWD_CANT_CHANGE 64 If 64, user cannot change password Use bitwise and to retrieve the actual settings userInfo.script_path The name of the logon script together with the path specification relative to the NETLOGON SCRIPT parameter userInfo.auth_flags The operator privileges granted to the user. These privileges include accounts, print, comm, and server. 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. A value of PC is equal to print and comm operator privilige userInfo.full_name The full name of the user userInfo.usr_comment The account comment which is a user-settable comment userInfo.parms The user account parameters userInfo.workstations The workstation restriction for the user userInfo.last_logon The last logon time userInfo.last_logoff The last logoff time userInfo.acct_expires The time the user account expires userInfo.max_storage The maximum storage allotted for the home directory userInfo.unit_per_week The number of hours within a week (7 * 24 = 168) userInfo.restricted_hours Logon restriction on certain hours 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-' userInfo.bad_pw_count The number of attempts to validate a bad password userInfo.num_logons The number of successful logons userInfo.logon_server The computer to handle logon requests for a user account userInfo.country_code The country code for the user 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: ═══ 12.31. NETUSERGROUPS Get Info ═══ The function lists the names of all groups in the user accounts subsystem (UAS) database to which a particular user account belongs. This function is identical to NetEnumerate(NETUSERGROUPS). Syntax MyRc = NetGetInfo(NETUSERGROUPS, 'userGroups', SrvName, UserId) Parameters The parameters specified are: 'userGroups' The REXX variable receiving the result. The variable is divided into: userGroups.0 The number of groups in which the user account has a entry userGroups.i The actual group name SrvName The server computer 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 groups in which a user is defined */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERGROUPS = 330 SrvName = '\\ILIDC' UserId = 'FMAM' myRc = NetGetInfo(NETUSERGROUPS, 'userGroups', SrvName, UserId) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end if userGroups.0 = 0 then do say 'User account belongs to no group' call DropLsRxutFuncs exit 0 end say 'Number of entries: ' userGroups.0 say do i=1 to userGroups.0 say 'Group Name: ' userGroups.i end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Number of entries: 3 Group Name: MANAGERS Group Name: HR_PRINT Group Name: USERS ═══ 12.32. NETUSERMODALS Get Info ═══ The function gets global modals related information for all user accounts and groups in the user accounts subsystem (UAS) database. Syntax MyRc = NetGetInfo(NETUSERMODALS, 'userModalsInfo', SrvName) Parameters The parameters specified are: 'userModalsInfo' The REXX variable receiving the result. The variable is divided into: userModalsInfo.min_passwd_len The minimum password length userModalsInfo.max_passwd_age The maximum password age in days userModalsInfo.min_passwd_age The minimum password age in days userModalsInfo.force_logoff The length of time (in seconds) after the valid logon hours that the user should be forced off the network userModalsInfo.password_hist_len The length of the password history, that is, the number of passwords in the history buffer that are scanned versus the new password in a password change attempt SrvName The server computer name of the domain controller Note The server computer name can be specified as '' for a local domain controller. Example /* Get user modals information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETUSERMODALS = 360 SrvName = '\\ILIDC' myRc = NetGetInfo(NETUSERMODALS, 'userModalsInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Minimum password length: ' userModalsInfo.min_passwd_len say 'Maximum password age: ' userModalsInfo.max_passwd_age say 'Minimum password age: ' userModalsInfo.min_passwd_age say 'Forced logoff time: ' userModalsInfo.force_logoff say 'Password history length: ' userModalsInfo.password_hist_len call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Minimum password length: 4 Maximum password age: Unlimited Minimum password age: No delay required Forced logoff time: Never Password history length: 8 ═══ 12.33. NETWKSTA Get Info ═══ The function returns information about the configuration components of the LAN requester component. Syntax MyRc = NetGetInfo(NETWKSTA, 'wkstaInfo', SrvName) Parameters The parameters specified are: 'wkstaInfo' The REXX variable receiving the result. The variable is divided into: wkstaInfo.root A string containing the path to the IBMLAN directory of the computer wkstaInfo.computername The computer name of the requester being queried wkstaInfo.username A string containing the name of the user who is logged on to the requester wkstaInfo.langroup A string containing the name of the domain to which the requester belongs wkstaInfo.ver_major The major software version (Version) wkstaInfo.ver_minor The minor software version (Release) wkstaInfo.charwait The number of seconds the requester waits for a remote serial or communication device to become available wkstaInfo.chartime The number of milliseconds the requester waits to collect data to send to a remote serial or communication device wkstaInfo.charcount The number of bytes of information the requester sends to a remote serial or communication device wkstaInfo.keepconn The number of seconds an inactive connection from the requester to a resource of a server is maintained wkstaInfo.keepsearch The number of seconds an inactive search continues wkstaInfo.maxthreads The number of threads the requester can dedicate to the network wkstaInfo.maxcmds The number of simultaneous network device driver commands that can be sent to the network wkstaInfo.numworkbuf The number of internal buffers the requester has wkstaInfo.sizworkbuf The size (in bytes) of each internal buffer wkstaInfo.maxwrkcache The maximum size (in bytes) of an internal cache buffer wkstaInfo.sesstimeout The number of seconds before an inactive session between a requester and a server is discontinued wkstaInfo.sizerror The size (in bytes) of an internal error buffer wkstaInfo.numalerts The maximum number of clients that can receive alert messages wkstaInfo.numservices The number of services that can be started on the requester at any time wkstaInfo.errlogsz The maximum size (in KB) of the error log file of the requester wkstaInfo.printbuftime The number of seconds closing print jobs are closed wkstaInfo.numcharbuf The number of character pipe buffers and device buffers the requester can have wkstaInfo.sizcharbuf The maximum size (in bytes) of a character pipe buffer and device buffer wkstaInfo.logon_server A string containing the name of the preferred server, which validates user logon requests for this userid wkstaInfo.wrkheuristics A string of flags used to control a requesters operation wkstaInfo.mailslots Specifies whether mailslots are allowed. If the value is 0, mailslots are not supported on this machine, and Netlogon service will not start wkstaInfo.logon_domain Names the domain to which the user is logged on. If no one is logged on, it is returned as -none- wkstaInfo.oth_domains A string listing all domains on which the machine currently is listed wkstaInfo.numdgrambuf The number of buffers allocated for receiving datagrams SrvName The server computer name Note The server computer name can be specified as '' for a local server or requester. Example /* Get wksta information */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETWKSTA = 350 SrvName = '\\ILIDC' myRc = NetGetInfo(NETWKSTA, 'wkstaInfo', SrvName) if myRc <> '0' then do say 'Got error from NetGetInfo() ' myRc call DropLsRxutFuncs exit 9 end say say 'Computer Name: ' wkstaInfo.computername say 'User Id logged on: ' wkstaInfo.username say 'LAN Group: ' wkstaInfo.langroup say 'Major version number: ' wkstaInfo.ver_major say 'Minor version number: ' wkstaInfo.ver_minor say 'Logon domain: ' wkstaInfo.logon_domain say 'Other domains: ' wkstaInfo.oth_domains call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit 0 Example Output Computer Name: \\ILIDC User Id logged on: LINDBERG LAN Group: ILI Major version number: 3 Minor version number: 0 Logon domain: ILI Other domains: -none- ═══ 13. NetMisc ═══ The NetMisc() function contains a set of functions that are outsite the normal add, delete, enumerate, get and get operations. The Net Misc functions are family of functions that can be called with a number of parameters. The use of the function NetMisc() has a minimum of two different parameters. The generic syntax is: MyRc = NetMisc(option, 'stemvar', parm1, parm2, parm3) MyRc = NetMisc(option, parm1, parm2, parm3) The option parameter contains a value to determine what type or option has to be handled. The parm1, parm2, parm3 parameters are dependent on the performed option. The MyRc parameter is the return code that will have an value from the NetMisc() function. If the call is successful the character '0' will be returned. Otherwise an error code and descriptive text are inserted by the NetMisc() function. The option parameter values are defined in Option parameter values. ═══ 13.1. NetMisc(NETACCESSCHECK) ═══ The function verifies that a userid has the proper access permission for a particular resource. A successful call to this function can be issued only from an OS/2 application to the local computer. If you are using a redirected drive as parameter, the return code of the function will be 2222. Syntax MyRc = NetMisc(NETACCESSCHECK, 'aclInfo', UserId, Resource) Parameters The parameters required and returned are: 'aclInfo' The access control profile information variable, which is divided into: aclInfo.access The access rights to query. The access control flags are as defined follows: - N None - A Attribute - R Read - W Write - C Create - X Execute - D Delete - P Permissions - G This is a Group permission aclInfo.return The returned value from the function call. If the value is 0, the access is granted as specified, otherwise the access will not be granted (return = 5, Access Denied) UserId The user account name Resource The resource specification Example /* Check access to a resource for a userid */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESSCHECK = 420 Resource = 'C:\IBMLAN\DCDB' UserId = 'TEST1' aclInfo.access = 'RWC' /* Not 0 in return */ /* aclInfo.access = 'R' Should return 0 */ myRc = NetMisc(NETACCESSCHECK, 'aclInfo', UserId, Resource) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'User access checked successfully' say '0 ok, otherwise bad. Access is' aclInfo.return end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output User access checked successfully 0 ok, otherwise bad. Access is 0 ═══ 13.2. NetMisc(NETACCESSAPPLY) (LS40) ═══ The function replicates a defined permission record, applying it to all subdirectories under the directory specified. The function updates the access permission for any file within the directory tree that already has an access permission record. It does not create a record for a file that does not already have one. This function does not replace existing audit trail settings, but it does apply the audit settings of the specified directory to any of its subdirectories that have no audit settings. This function will not apply an access permission record to any of the following OS/2 LAN Server system subdirectories: \IBMLAN \IBMLAN\DCDB and its subdirectories \IBMLAN\NETPROG and its subdirectories \IBMLAN\DOSLAN and its subdirectories Syntax MyRc = NetMisc(NETACCESSAPPLY, 'applyInfo', SrvName, DirResource) Parameters The parameters required and returned are: 'applyInfo' The access control profile error information variable, which is valid only in case of apply errors applyInfo.error_buf A string specifying the complete path name of the resource that contributed to the failure of the apply function applyInfo.error_code The error code returned when the ACL for resource specified in applyInfo.error_buf was changed SrvName The computer name of the server where the directory resource resides DirResource The directory resource specification Example /* Apply access control profile to resource */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETACCESSAPPLY = 520 SrvName = '\\DOMAIN_CONTRLR' DirResource = 'C:\TEST' /* Resource on the server */ myRc = NetMisc(NETACCESSAPPLY, 'applyInfo', SrvName, DirResource) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc say 'Error Code from Apply' applyInfo.error_code say 'Apply function failed at' say applyInfo.error_buf exitRc = 9 end else do say 'Apply function was successfull' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Apply function was successfull ═══ 13.3. NetMisc(NETAUDITLOGCLEAR) ═══ The function clears and optionally saves the audit log file of a computer. Syntax MyRc = NetMisc(NETAUDITLOGCLEAR, SrvName, save2File) Parameters The parameters required and returned are: SrvName The computer name of the server to perform the operation on. If the computer is local use '' as the value for the server name save2File A string assigning a name for an optional backup file. The calling application must have write privileges for the path specified by this parameter. If the path name is relative, it is assumed to be relative to the IBMLAN\LOGS directory Example /* Clear the audit log file and make a backup copy of it */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGCLEAR = 580 SrvName = '\\DOMAIN_CONTRLR' save2File = 'AUDITLOG.001' myRc = NetMisc(NETAUDITLOGCLEAR, SrvName, save2File) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'The operation completed successfully' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output The operation completed successfully ═══ 13.4. NetMisc(NETDASDCHECK) (LS40) ═══ The function returns the amount of disk space available and the amount already taken in a specified directory tree. Before this function can be invoked successfully, directory limits must be enabled on the 386-HPFS drive. (See the NetMisc(NETDASDCONTROL) function) Syntax MyRc = NetMisc(NETDASDCHECK, 'DASDInfo', SrvName) Parameters The parameters required and returned are: 'DASDInfo' The directory limits information variable, which is divided into: DASDInfo.DirPath The directory path to check. If a redirected drive is specified for DASDInfo.DirPath, the server name parameter value must be '' This parameter must be specified DASDInfo.path The directory that limits the space available, beginning with the drive letter DASDInfo.avail The available disk space (in KB) remaining in the entire tree of the specified directory DASDInfo.usage The amount of disk space (in KB) already occupied in the directory indicated by DASDInfo.path SrvName The computer name of the server to perform the check on. If a redirected drive is specified for DASDInfo.DirPath, the server name parameter value must be '' Example /* Check DASD directory limits on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASDCHECK = 730 DASDInfo.DirPath = 'D:\APPS\DATA' SrvName = '\\DOMAIN_CONTRLR' myRc = NetMisc(NETDASDCHECK, 'DASDInfo', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'The Directory limits are' say 'Path ' DASDInfo.path say 'Available Space' DASDInfo.avail say 'In use ' DASDInfo.usage exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output The Directory limits are' Path D:\APPS\DATA Available Space 512 In use 201 ═══ 13.5. NetMisc(NETDASDCONTROL) (LS40) ═══ The function prepares a 386-HPFS drive for directory limits. Before any other directory limits functions can be used on a drive, that drive must be enabled (only once) for directory limits by using either this function, the NET DASD command, or the OS/2 LAN Server Administration Graphical User Interface. Syntax MyRc = NetMisc(NETDASDCONTROL, 'DASDControl', SrvName) Parameters The parameters required and returned are: 'DASDControl' The directory limits control variable, which is divided into: DASDControl.CtlFlag The control function to be performed on the 386-HPFS drive. Available values for this control flag are: Value Meaning ----- ------- 1 Enables directory limits support on the specified drive 2 Disables directory limits support on the specified drive 3 Recalculates the space used in all of the directories of the drive specified that have directory limits placed upon them The default value is 1 (Enable directory limits) DASDControl.Drive The letter of the drive upon which the DASD control function is to operate. This drive must reside on the server specified by the SrvName parameter. The default drive value is 'C' SrvName The computer name of the server to perform the control on. The server name specified can be '' for a local server Remark If the call is executed on a remote server a timeout code might be returned if no response is received from the server. This function might take up to several minutes to complete execution, especially on a large drive. Therefore, it can return a nonzero return code, while the remote function is still running. If one of the following error codes is returned by a call to NetMisc(NETDASDCONTROL), a timeout probably has occurred: Value Meaning ----- ------- 64 The network name was deleted 67 This network name cannot be found 240 The session was canceled 2141 The server is not configured for transactions These error codes do not mean necessarily that the NetMisc(NETDASDCONTROL) function failed. The function might still be running remotely. You can execute the function on the server in question to avoid this problem. Example /* Activate DASD directory limits on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETDASDCONTROL = 740 DASDControl.CtlFlag = 1 DASDControl.Drive = 'C' SrvName = '\\DOMAIN_CONTRLR' myRc = NetMisc(NETDASDCONTROL, 'DASDControl', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'DASD Directory Limits enabled successfully' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output DASD Directory Limits enabled successfully ═══ 13.6. NetMisc(NETERRORLOGCLEAR) ═══ The function clears and optionally saves the error log file of a computer. Syntax MyRc = NetMisc(NETERRORLOGCLEAR, SrvName, save2File) Parameters The parameters required and returned are: SrvName The computer name of the server to perform the operation on. If the computer is local use '' as the value for the server name save2File A string assigning a name for an optional backup file. The calling application must have write privileges for the path specified by this parameter. If the path name is relative, it is assumed to be relative to the IBMLAN\LOGS directory Example /* Clear the error log file and make a backup copy of it */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGCLEAR = 640 SrvName = '\\DOMAIN_CONTRLR' save2File = 'ERRORLOG.001' myRc = NetMisc(NETERRORLOGCLEAR, SrvName, save2File) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'The operation completed successfully' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output The operation completed successfully ═══ 13.7. NetMisc(NETERRORLOGREAD) ═══ The function returns read enries from the error log. Syntax MyRc = NetMisc(NETERRORLOGREAD, 'errInfo', SrvName) Parameters The parameters required and returned are: 'errInfo' The error information and control variable, which is divided into: errInfo.openflags The read operation control flags. The values controlling the read operation are: Value Read direction ----- -------------- 0 Read the oldest records in the error log first 1 Read the newest records first Value Record read options ----- ------------------- 0 Read sequentially from the beginning 2 Read from the nth. record specified in the errInfo.offset parameter A value of 3 for this variable is identical to read the newest records first and read from the record number as specified in the errInfo.offset parameter errInfo.openflags The default value is 0 which is identical to read the oldest records first and read sequentially errInfo.offset This parameter specifies the record number the read operation should be starting from. It requires that the errInfo.openflags has the value 2 included errInfo.buffer The size of the internal working buffer. The value has a maximum of 64KB. The default value is 4KB. errInfo.resume The error log can be processed in multiple steps. Specify 'INITRESUME' first time and 'RESUME' in next following calls to the procedure. See also errInfo.bytesavail The default operation is to neglect this parameter errInfo.bytesavail The errInfo.bytesavail variable returns information about the amount if data available. It is only valid if errInfo.resume is specified. If errInfo.bytesavail is not 0, then more data is available in the error log. Continue to call the function with errInfo.resume equal to 'RESUME' until the parameter errInfo.bytesavail returns a 0 value errInfo.count The number of error log entries returned. The value can be 0 errInfo.i.time The time as the error log entry i was inserted to the log file errInfo.i.errcode The error code reported in the log file errInfo.i.component The reporting component errInfo.i.nstrings The number of text strings related to the error log entry i errInfo.i.string.n The nth text string for the error log entry i errInfo.i.rawlength The associated raw data length. This value will be 0 is now raw data is associated to the error log entry i errInfo.i.rawdata The raw data available. This variable is valid only if errInfo.i.rawlength is different from 0 SrvName The computer name of the server to perform the operation on. Use the value '' for a local computer Example /* Read error log entries on server */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGREAD = 650 SrvName = '\\DOMAIN_CONTRLR' myRc = NetMisc(NETERRORLOGREAD, 'errInfo', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Bytes available: ' errInfo.bytesavail say 'Number of entries:' errInfo.count do i = 1 to errInfo.count say say 'Time: ' errInfo.i.time say 'Error Code: ' errInfo.i.errcode say 'Component: ' errInfo.i.component say 'Text strings: ' errInfo.i.nstrings if errInfo.i.nstrings <> 0 then do do j = 1 to errInfo.i.nstrings say 'String text: ' errInfo.i.string.j end end say say 'Raw data length:' errInfo.i.rawlength if errInfo.i.rawlength <> 0 then do do j = 1 to 5 say C2X(substr(errInfo.i.rawdata,j,1)) end end end exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Bytes available: 0 Number of entries: 1 Time: Mon Sep 5 13:14:01 1994 Error Code: 99 Component: MY_PROC_1 Text strings: 2 String text: Error occurred in function error handler String text: The server computer name was not specified Raw data length: 32 00 01 02 03 04 Example using RESUME operation and record offset /* Read error log entries on server using RESUME operation */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGREAD = 650 SrvName = '' entries = 0 errInfo.resume = 'INITRESUME' errInfo.buffer = 512 errInfo.openflags = 2 errInfo.offset = 145 SrvName = '\\DOMAIN_CONTRLR' call theProc if errInfo.bytesavail <> 0 then do errInfo.resume = 'RESUME' errInfo.openflags = 0 /* This must be 0 or myRc=2440 */ do while errInfo.bytesavail <> 0 call theProc end end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc /*************************/ /* Get error log entries */ /*************************/ theProc: myRc = NetMisc(NETERRORLOGREAD, 'errInfo', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc end else do say 'Bytes available: ' errInfo.bytesavail say 'Number of entries:' errInfo.count do i = 1 to errInfo.count say say 'Time: ' errInfo.i.time say 'Error Code: ' errInfo.i.errcode say 'Component: ' errInfo.i.component say 'Text strings: ' errInfo.i.nstrings if errInfo.i.nstrings <> 0 then do do j = 1 to errInfo.i.nstrings say 'String text: ' errInfo.i.string.j end end say say 'Raw data length:' errInfo.i.rawlength if errInfo.i.rawlength <> 0 then do do j = 1 to 5 say C2X(substr(errInfo.i.rawdata,j,1)) end end end exitRc = 0 end return ═══ 13.8. NetMisc(NETERRORLOGWRITE) ═══ The function writes a entry into the error log. The function is only supported on a local computer. To correctly read the entries, use the NetMisc(NETERRORLOGREAD) function. The NET command line interface makes use of the OS/2 system and OS/2 LAN Server messages while formatting error log entries. The may cause log entries to appear differently from the actual content of the values inserted by this function. Syntax MyRc = NetMisc(NETERRORLOGWRITE, 'errInfo') Parameters The parameters required and returned are: 'errInfo' The error information control variable, which is divided into: errInfo.errcode The error code. The error code will be limited to 2 bytes (16 bit) The default error code is 87 (invalid parameter) errInfo.component The name of the component reporting the error. If no value is specified the string 'REXX_PROCEDURE' will be used. The maximum length of this parameter is 15 characters errInfo.nstrings The number of text string to insert into the error message. The default is to insert 0 strings errInfo.string.n Error text message string number n, where variable n has a value from 1 to errInfo.nstrings. The maximum string length is limited to 260 bytes for each entry If errInfo.nstrings is specified, but no string is supplied the default text string 'REXX' will be inserted errInfo.rawdata The raw data available from the REXX procedure. It can contains a string of values that includes non printable characters errInfo.rawlength The length of the hexadecimal raw data. The default value is 0 and the maximum length is 256 bytes Example /* Write error log entry on local computer */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGWRITE = 660 errInfo.errcode = 99 errInfo.component = 'MY_PROC_1' errInfo.nstrings = 2 errInfo.string.1 = 'Error occurred in the function error handler' errInfo.string.2 = 'The server computer name was not specified' errInfo.rawdata = '' do i=0 to 32 errInfo.rawdata = errInfo.rawdata || D2C(i) end errInfo.rawlength = 32 myRc = NetMisc(NETERRORLOGWRITE, 'errInfo') if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Log entry inserted to error log' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Log entry inserted to error log ═══ 13.9. NetMisc(NETMESSAGEBUFFERSEND) ═══ The functions sends a buffer of information to a registered messaging name. Syntax MyRc = NetMisc(NETMESSAGEBUFFERSEND, Message, toName, SrvName) Parameters The parameters required are: Message The message string to be send For broadcast messages to the physical network, where toName points to "*" or to "domain (*)", the message can be no longer than 128 bytes (and is not guaranteed to be delivered). For messages sent to all message names on a domain, the limit is 128 bytes. Otherwise, the message can be any length, provided it does not exceed the maximum receivable message size for that computer, which is set with the 'sizmessbuf' parameter in IBMLAN.INI. The total size of 'sizmessbuf' can be divided among different messages, if messages are arriving at the same time. This reduces the actual size of any single message that can be received. In addition, the sizmessbuf parameter can accept only limited values. The function does not require the Messenger service to be started on a local computer. toName A string containing the name of the userid or application to receive the message. To broadcast a message to all requesters on the LAN, have the value of toName be an asterisk (*) wildcard. To broadcast a message to all users on a domain, have the value of toName be the domain name followed by an asterisk (*). A value must be supplied SrvName A remote server computer name if remote, otherwise '' Example /* Send a message */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGEBUFFERSEND = 530 Message = 'Server backup of user data has completed' toName = 'ADMIN04' SrvName = '\\ANYSRV01' myRc = NetMisc(NETMESSAGEBUFFERSEND, Message, toName, SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Message sent successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message sent successfully ═══ 13.10. NetMisc(NETMESSAGEFILESEND) ═══ The functions sends a file of information to a registered messaging name. Syntax MyRc = NetMisc(NETMESSAGEFILESEND, MessageFile, toName, SrvName) Parameters The parameters required are: MessageFile The file to sent The value is a string containing the full path and the file name of the file to be sent. For broadcast messages to the physical network, where toName points to "*" or to "domain (*)", the messageFile can be no longer than 128 bytes (and is not guaranteed to be delivered). For messages sent to all message names on a domain, the limit is 128 bytes. Otherwise, the messageFile can be any length, provided it does not exceed the maximum receivable message size for that computer, which is set with the sizmessbuf parameter in IBMLAN.INI. The total size of sizmessbuf can be divided among different messages, if messages are arriving at the same time. This reduces the actual size of any single message that can be received. In addition, the sizmessbuf parameter can accept only limited values. The function does not require the Messenger service to be started on a local computer. toName A string containing the name of the userid or application to receive the message. To broadcast a message to all requesters on the LAN, have the value of toName be an asterisk (*) wildcard. To broadcast a message to all users on a domain, have the value of toName be the domain name followed by an asterisk (*). A value must be supplied SrvName A server computer name if remote, otherwise '' Example /* Sent a message from a file */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGEFILESEND = 540 MessageFile = 'C:\BACKUP.OK' toName = 'ADMIN04' SrvName = '\\ANYSRV01' myRc = NetMisc(NETMESSAGEFILESEND, MessageFile, toName, SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Message from file sent successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message from file sent successfully ═══ 13.11. NetMisc(NETMESSAGENAMEFWD) ═══ The function changes the message name table to forward messages to another messaging name. Syntax MyRc = NetMisc(NETMESSAGENAMEFWD, msgName, fwdAction, fwdName, SrvName) Parameters The parameters required are: msgName A string specifying the name receiving messages fwdAction A integer specifying the action to take if name forwards messages to another name. If the value is nonzero, any previous forwarded name is deleted; if 0, any previous forwarded name is not deleted and an error is returned The default value is 0 fwdName A string specifying the name to receive msgName forwarded messages SrvName A server computer name if remote otherwise '' Example /* Forward a message name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAMEFWD = 560 msgName = 'ADMIN04' fwdAction = 0 fwdName = 'USERID' SrvName = '' /* This local computer */ myRc = NetMisc(NETMESSAGENAMEFWD, msgName, fwdAction, fwdName, SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Message name forwarded successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message name forwarded successfully ═══ 13.12. NetMisc(NETMESSAGENAMEUNFWD) ═══ The function stops forwarding of messages. Syntax MyRc = NetMisc(NETMESSAGENAMEUNFWD, msgName, SrvName) Parameters The parameters required are: msgName The string specifying the userid name whose message forwarding is to be canceled. A value must be specified SrvName A server computer name if remote otherwise '' Example /* Un-Forward a message name */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETMESSAGENAMEUNFWD = 570 msgName = 'ADMIN04' SrvName = '' myRc = NetMisc(NETMESSAGENAMEUNFWD, msgName, SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Message name un-forwarded successfully' end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc Example Output Message name un-forwarded successfully ═══ 13.13. NetMisc(NETREMOTECOPY) ═══ Performs a remote file copy on a server. Syntax MyRc = NetMisc(NETREMOTECOPY, SrcPath, DestPath, 'VarInfo') Parameters The parameters required and returned are: SrcPath The redirected source path DestPath The redirected destination path 'VarInfo' which is divided into: VarInfo.openflags Controls the file open (a decimal value). The file open options defined as follows: Bit Meaning --- ------- 0-1 Used if destpath exists. If 0, the open fails; if 1, the file is appended; and if 2, the file is overwritten 2-3 Reserved, with a value of 0. 4 Used if destpath does not exist. If 0, the open fails; if 1, the file is created 5-15 Reserved, with a value of 0. The value must be converted to decimal before the function call. The default value is 0x0012 which is equal to 18 in decimal VarInfo.copyflags Controls the copy options expressed in decimal. File copy options defined as follows: Bit Meaning --- ------- 0 If 1, destpath must be a file. If bit 0 is set to 1, bit 1 must be 0 1 If 1, destpath must be a directory. If bit 1 is set to 1, bit 0 must be 0 2 If 0, destpath is opened in binary mode. If 1, destpath is opened in text mode 3 If 0, sourcepath is opened in binary mode. If 1, sourcepath is opened in text mode 4 If 1, all writes are verified 5-15 Reserved. The value must be converted to decimal before the function call. The default value is 0x0011 which is equal to 17 in decimal VarInfo.ci_num_copied The number of files copied VarInfo.ci_err_buf The string buffer containing error information of the copy operation Example /* Perform Net remote copy */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETREMOTECOPY = 670 SrvName = '\\KING_BALU' SrcPath = 'Y:\CONFIG.SYL' DestPath = 'Y:\CONFIG.BAC' VarInfo.openflags = x2d('0012') VarInfo.copyflags = x2d('0011') myRc = NetMisc(NETREMOTECOPY, SrcPath, DestPath, 'VarInfo', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc rcCode = 9 end else do say 'Number files copied ' VarInfo.ci_num_copied say 'Error Information ' VarInfo.ci_err_buf rcCode = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode Example Output Number files copied 1 Error Information ═══ 13.14. NetMisc(NETREMOTEMOVE) ═══ Performs a remote file move on a server. Syntax MyRc = NetMisc(NETREMOTEMOVE, SrcPath, DestPath, 'VarInfo') Parameters The parameters required and returned are: SrcPath The redirected source path DestPath The redirected destination path 'VarInfo' which is divided into: VarInfo.openflags Controls the file open. The file open options are defined as follows: Bit Meaning --- ------- 0-1 Used if destpath exists. If 0, the open fails; if 1, the file is appended; and if 2, the file is overwritten. 2-3 Reserved, with a value of 0. 4 Used if destpath does not exist. If 0, the open fails; if 1, the file is created. 5-15 Reserved, with a value of 0. The value must be converted to decimal before the function call. The default value is 0x0012 which is equal to 18 in decimal VarInfo.moveflags Controls the move options, expressed in decimal. File move options defined as follows: Bit Meaning --- ------- 0 If 1, destpath must be a file, and bit 1 must be 0. 1 If 1, destpath must be a directory, and bit 0 must be 0. 2-15 Reserved; the value of these bits must be 0. The value must be converted to decimal before the function call. The default value is 0x0002 which is equal to 2 in decimal VarInfo.mi_num_moved The number of files moved VarInfo.mi_err_buf The string buffer containing error information of the move operation Example /* Some */ /* Perform Net remote move */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETREMOTEMOVE = 690 SrvName = '\\KING_BALU' SrcPath = 'Y:\CONFIG.ORG' DestPath = 'Y:\OS2' VarInfo.openflags = x2d('0012') VarInfo.moveflags = x2d('0002') myRc = NetMisc(NETREMOTEMOVE, SrcPath, DestPath, 'VarInfo') if myRc <> '0' then do say 'Got error from NetMisc() ' myRc rcCode = 9 end else do say 'Number files moved ' VarInfo.mi_num_moved say 'Error Information ' VarInfo.mi_err_buf rcCode = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode Example Output /* some */ Number files moved 1 Error Information ═══ 13.15. NetMisc(NETREMOTETOD) ═══ Retrieves the remote time of the day from a remote server. Syntax MyRc = NetMisc(NETREMOTETOD, 'VarRet', SrvName) Parameters The parameters required are: 'VarRet' variable, which is divided into: VarRet.tod_elapsedt The number of seconds that have elapsed since 1 January 1970 VarRet.tod_hours The current hour VarRet.tod_mins The current minute VarRet.tod_secs The current second VarRet.tod_hunds The current hundredths of a second VarRet.tod_msecs The current millisecond VarRet.tod_timezone The time zone of the server, calculated (in minutes) from the Greenwich mean time (GMT) zone VarRet.tod_tinterval The time interval for each tick of the clock represneted in 0.0001 seconds VarRet.tod_day The day of the month (1-31) VarRet.tod_month The month (1-12) VarRet.tod_year The year, starting with 0 VarRet.tod_weekday The day of the week (0 means Sunday; 6 means Saturday) SrvName The server computer name Example /* Perform Net remote TOD */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETREMOTETOD = 700 SrvName = '\\KING_BALU' myRc = NetMisc(NETREMOTETOD, 'VarRet', SrvName) if myRc <> '0' then do say 'Got error from NetMisc() ' myRc rcCode = 9 end else do say 'Seconds elaps ' VarRet.tod_elapsedt say 'Current Hour ' VarRet.tod_hours say 'Current Minute ' VarRet.tod_mins say 'Current Second ' VarRet.tod_secs say 'Current 1/100 sec ' VarRet.tod_hunds say 'Current mSec ' VarRet.tod_msecs say 'Timezone in minutes ' VarRet.tod_timezone say 'Timer Tic in 1/10000 Secs' VarRet.tod_tinterval say 'Day ' VarRet.tod_day say 'Month ' VarRet.tod_month say 'Year ' VarRet.tod_year say 'Day of week ' VarRet.tod_weekday rcCode = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode Example Output Seconds elaps 777749783 Current Hour 17 Current Minute 36 Current Second 23 Current 1/100 sec 66 Current mSec 96781561 Timezone in minutes 65535 Timer Tic in 1/10000 Secs 310 Day 24 Month 8 Year 1994 Day of week 3 ═══ 13.16. NetMisc(NETSERVERADMINCMD) ═══ The function executes a program on a remote server. Syntax MyRc = NetMisc(NETSERVERADMINCMD, RunCommand, SrvName, 'ReturnValue') Parameters The parameters required and returned are: RunCommand The command to be executed at the remote server SrvName The server computer name 'ReturnValue' which is divided into: ReturnValue.exitCode The program exit code ReturnValue.available The number of bytes available at the remote location ReturnValue.returned The number of bytes in the program output. This is limited to 4KB using the NetMisc(NETSERVERADMINCMD) function ReturnValue.output The program output. This is limited to 4KB in the NetMisc(NETSERVERADMINCMD) function Example /* Perform Net remote admin cmd */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETSERVERADMINCMD = 710 RunCommand = 'DIR C:\' SrvName = '\\KING_BALU' myRc = NetMisc(NETSERVERADMINCMD, RunCommand, SrvName, 'ReturnValue') if myRc <> '0' then do say 'Got error from NetMisc() ' myRc rcCode = 9 end else do say 'Remote Exit code was ' ReturnValue.exitCode say 'Returned Bytes are ' ReturnValue.returned say 'Number bytes at remote location' ReturnValue.available say 'OutPut was' say ReturnValue.output rcCode = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit rcCode Example Output Remote Exit code was 0 Returned Bytes are 1159 Number bytes at remote location 1159 OutPut was The volume label in drive C is OS2. The Volume Serial Number is A69B:F814 Directory of C:\ 8-24-94 1:39p