home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / network / rexxlan / smples20 / whoami.cmd < prev   
OS/2 REXX Batch file  |  1993-11-07  |  2KB  |  41 lines

  1. /* ********************************************************************* */
  2. /*                                                                       */
  3. /*   File:       WHOAMI.CMD                                              */
  4. /*   Version:    1.0                                                     */
  5. /*   Date:       1.7.1993                                                */
  6. /*                                                                       */
  7. /*   (c) EDV Beratung L. Braeuer, 1993                                   */
  8. /*                                                                       */
  9. /*   Purpose:    Test if a user is logged on. If so display his name     */
  10. /*                                                                       */
  11. /* ********************************************************************* */
  12.  
  13. /*                                                                       */
  14. /*  Initialize REXXLAN                                                   */
  15. /*                                                                       */
  16. call rxfuncadd NetLoadFuncs, RXLAN20, NetLoadFuncs
  17. CALL NetLoadFuncs
  18.  
  19. /*                                                                       */
  20. /*  Use NetWkstaGetInfo to test if a user is logged on. Write result in  */
  21. /*  "WkInfo". Use level 10 to enable user also to use it.                */
  22. /*                                                                       */
  23. SAY 'Querying workstation info...'
  24. ret =  NetWkstaGetInfo( '', '10', 'WkInfo', '0', '0' )
  25.  
  26. IF ret = 0 THEN DO
  27.    SAY 'Logged on user : ' || WkInfo.wki10_username
  28.    SAY 'Workstation    : ' || WkInfo.wki10_computername
  29.    SAY 'Logon domain   : ' || WkInfo.wki10_logon_domain
  30.    SAY 'Default domain : ' || WkInfo.wki10_langroup
  31.    END
  32. ELSE DO
  33.    SAY NetRexxGetMessage( ret )
  34.    END
  35.  
  36.  
  37. /*                                                                       */
  38. /* free REXXLAN resources                                                */
  39. /*                                                                       */
  40. CALL Netdropfuncs
  41.