home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Collection - Online Library - January 1996 / CKITOS2196.ISO / diskette / gg244043.dsk / unc.dsk / LS30UTIL / DMPUSR.CMD < prev    next >
OS/2 REXX Batch file  |  1993-02-10  |  2KB  |  65 lines

  1. /*******************************************************************/
  2. /* DMPUSR.CMD                                                      */
  3. /*                                                                 */
  4. /* Dump user information from one domain as preparation for        */
  5. /* transfer to another domain                                      */
  6. /*                                                                 */
  7. /* Arguments:                                                      */
  8. /*  users_list_file A file containing userids that will be         */
  9. /*                  transferred                                    */
  10. /*  dumpfile        A file that will contain the binary user       */
  11. /*                  information                                    */
  12. /*                                                                 */
  13. /* users_list_file is a text file containing the userids that are  */
  14. /*                 to be transferred.                              */
  15. /*                                                                 */
  16. /*          userid0                                                */
  17. /*          userid1                                                */
  18. /*          ...                                                    */
  19. /*          useridn                                                */
  20. /*                                                                 */
  21. /*******************************************************************/
  22.  
  23. parse upper arg usrListFile dumpFile
  24.  
  25. if usrListFile = '' then do
  26.  say 'Specify a user list file'
  27.  exit 9
  28. end
  29.  
  30. if dumpFile = '' then
  31.  dumpFile = 'C:\DUMPFILE.BIN'
  32.  
  33. /* Get access to LS30UT.DLL functions */
  34. call RxFuncAdd 'LoadLs30utFuncs', 'LS30UT', 'LoadLs30utFuncs'
  35. call LoadLs30utFuncs
  36.  
  37. parse value GetDCName() with rc dcName
  38.  
  39. if rc <> '0' then do
  40.  say 'Could not obtain Domain Controller name'
  41.  exit 9
  42. end
  43.  
  44. if dcName = '' then do
  45.  say 'Could not obtain Domain Controller name'
  46.  exit 9
  47. end
  48.  
  49. /* Ready to read user list file */
  50. userid = linein(usrListFile,1,1)
  51. if userid = '' then do
  52.  say 'Could not obtain User List File'
  53.  exit 9
  54. end
  55.  
  56. do while userid <> ''
  57.  rc = DumpUser(dcName, dumpFile, userid)
  58.  say 'DumpUser() reported: ' rc
  59.  userid = linein(usrListFile,,1)
  60. end
  61.  
  62. call DropLs30utFuncs
  63. exit 0
  64.  
  65.