home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rx_net.zip / test.cmd < prev   
OS/2 REXX Batch file  |  1993-09-10  |  3KB  |  134 lines

  1. /*   */
  2. "@ECHO OFF"
  3. /*
  4. trace ?i
  5. */
  6. parse arg template dest .
  7. if template = '' || dest = '' then do
  8.    say "Please supply name of template user and of destination user."
  9.    return -1
  10. end
  11.  
  12. call RXFuncAdd 'RXNET_LOADALL', 'RX_NET', 'RXNET_LOADALL'
  13. rc = RXNet_LoadAll()
  14. if rc <> 0 then do
  15.    say 'Error RXNet_LoadAll :'rc
  16.    return -1
  17. end
  18.  
  19. xxx = RX_GETDCName()
  20. say "Domain Controller of current domain : "xxx
  21. say ""
  22. "PAUSE"
  23.  
  24. xxx = RX_GETUSERS( "Users.")
  25. if xxx = 0 then do
  26.    say Users.0" users defined in current domain"
  27.    say " "
  28.    say ' Userid     '
  29.    say '------------'
  30.    do i=1 to Users.0
  31.       say ' 'Left( Users.i, 10)
  32.    end
  33. end; else do
  34.    say "Error issuing RX_GetUsers : "xxx
  35. end
  36. say ""
  37. "PAUSE"
  38.  
  39. xxx = RX_GETALIASES( "Aliases.")
  40. if xxx = 0 then do
  41.    say Aliases.0" aliases defined in current domain"
  42.    say " "
  43.    say ' Alias      | Type'
  44.    say '------------+---------'
  45.    do i=1 to Aliases.0
  46.       parse var Aliases.i Name Type  .
  47.       say ' 'Left( Name, 10)'| 'Left( Type, 8)
  48.    end
  49. end; else do
  50.    say "Error issuing RX_GetAliases : "xxx
  51. end
  52. say ""
  53. "PAUSE"
  54.  
  55. xxx = RX_GETAPPS( "Apps.")
  56. if xxx = 0 then do
  57.    say Apps.0" applications defined in current domain"
  58.    say " "
  59.    say ' Application | Type'
  60.    say '-------------+------------'
  61.    do i=1 to Apps.0
  62.       parse var Apps.i Name Type  .
  63.       say ' 'Left( Name, 11)'| 'Left( Type, 11)
  64.    end
  65. end; else do
  66.    say "Error issuing RX_GetApps : "xxx
  67. end
  68. say ""
  69. "PAUSE"
  70.  
  71. xxx = RX_GETAPPSEL( template, "test.")
  72. if xxx = 0 then do
  73.    say "Application selector for "template
  74.    say " "
  75.    say ' Application | Type'
  76.    say '-------------+-----------'
  77.    do i=1 to Test.0
  78.       parse var Test.i App Type  .
  79.  
  80.       say ' 'Left( App, 12)'| 'Left( Type, 10)
  81.    end
  82. end; else do
  83.    say "Error issuing RX_GetAppSel for "template": "xxx
  84. end
  85. say ""
  86. "PAUSE"
  87.  
  88. say "Do you want to apply these settings to "dest" (Y/N)?"
  89. parse pull ans
  90. if ans = 'Y' | ans = 'y' then do
  91.  
  92.    xxx = RX_SETAPPSEL( dest, "TeSt.")
  93.    if xxx <> 0 then do
  94.       say "Error issuing RX_SetAppSel for "dest": "xxx
  95.    end; else do
  96.       say "Set successful !"
  97.    end
  98.  
  99. end
  100. say ""
  101. "PAUSE"
  102.  
  103. xxx = RX_GETLOGONASN( template, "test.")
  104. if xxx = 0 then do
  105.    say "Logon assignments for "template
  106.    say " "
  107.    say ' Alias      | Type      | Device'
  108.    say '------------+-----------+--------'
  109.    do i=1 to Test.0
  110.       parse var Test.i Alias Type Device
  111.  
  112.       say ' 'Left( Alias, 11)'| 'Left( Type, 10)'| 'Device
  113.    end
  114. end; else do
  115.    say "Error issuing RX_GetLogonAsn for "template": "xxx
  116. end
  117. say ""
  118. "PAUSE"
  119.  
  120. say "Do you want to apply these settings to "dest" (Y/N)?"
  121. parse pull ans
  122. if ans = 'Y' | ans = 'y' then do
  123.  
  124.    xxx = RX_LOGONASN( dest, "TeSt.")
  125.    if xxx <> 0 then do
  126.       say "Error issuing RX_SetLogonAsn for "dest": "xxx
  127.    end; else do
  128.       say "Set successful !"
  129.    end
  130.  
  131. end
  132.  
  133. call RXNET_DROPALL
  134.