home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244043.dsk / unc.dsk / LS30UTIL / ALLASN.CMD next >
OS/2 REXX Batch file  |  1993-03-03  |  3KB  |  95 lines

  1. /*******************************************************************/
  2. /* ALLASN.CMD                                                      */
  3. /*                                                                 */
  4. /* Get logon assignments for a all defines users                   */
  5. /* No arguments are used                                           */
  6. /*                                                                 */
  7. /* Result:                                                         */
  8. /*                  type A= for public application assignment      */
  9. /*                       D= for device assignment, such as         */
  10. /*                          G:, COM5, LPT3 or none                 */
  11. /*                                                                 */
  12. /* Examples of returned values:                                    */
  13. /*                  userid= DEPT001                                */
  14. /*                  D=   G:     FILESDIR                           */
  15. /*                  D=   COM3   COMPORT                            */
  16. /*                  A=          PUBLICAP                           */
  17. /*                                                                 */
  18. /*                  userid= DEPT002                                */
  19. /*                  D=   O:     FILESDIR                           */
  20. /*                  D=   COM7   COMPORT                            */
  21. /*                  A=          PUBLICAP                           */
  22. /*                                                                 */
  23. /*                  userid= DEPT003                                */
  24. /*                  -none-                                         */
  25. /*******************************************************************/
  26.  
  27. parse upper arg dummy
  28.  
  29. call LoadFuncs; /* Load DLL utility functions */
  30.  
  31. /* Get user names into rxqueue */
  32. '@net users | rxqueue'
  33. pull line ; pull line
  34. pull line ; pull line
  35. do while queued() > 1
  36.  
  37.  parse pull userId userId1 userId2
  38.  
  39.  call getLASN STRIP(userId);
  40.  if userId1 <> '' then do
  41.   call getLASN STRIP(userId1);
  42.   if userId2 <> '' then do
  43.    call getLASN STRIP(userId2);
  44.   end
  45.  end
  46.  
  47. end
  48.  
  49. call DropFuncs
  50. exit 0
  51.  
  52. /*************************************************************/
  53. /* get Logon assignments                                     */
  54. /*************************************************************/
  55. getLASN:
  56.  arg userName
  57.  
  58.  parse upper var userName
  59.  rc = GetLogonAsn(userName, 'listIt')
  60.  
  61.  if rc = '0' then do
  62.   say 'userid=' userName
  63.   do i=1 to listIt.0
  64.    say listIt.i
  65.   end
  66.  end
  67.  else do
  68.   say 'Error occured. Returncode from GetLogonAsn() was: ' rc
  69.  end
  70.  say
  71.  
  72. return
  73.  
  74. /*************************************************************/
  75. /* Load DLL Functions                                        */
  76. /*************************************************************/
  77. LoadFuncs:
  78.  
  79.  /* Load LS30UT.DLL functions */
  80.  call RxFuncAdd 'LoadLs30utFuncs', 'LS30UT', 'LoadLs30utFuncs'
  81.  call LoadLs30utFuncs
  82.  
  83. return
  84.  
  85. /*************************************************************/
  86. /* Drop DLL Functions                                        */
  87. /*************************************************************/
  88. DropFuncs:
  89.  
  90.  /* Drop LS30UT.DLL functions */
  91.  call DropLs30utFuncs
  92.  
  93. return
  94.  
  95.