Powered by GeSHi

Source code for getalluserdetails.bat

(view source code of getalluserdetails.bat as plain text)

  1. @ECHO OFF
  2. ECHO.>CON
  3. ECHO GetAllUserDetails, Version 1.00 for Windows NT 4 and higher >CON
  4. ECHO Gathers details to all users in the domain >CON
  5. ECHO.>CON
  6. ECHO Based on a script by Rob van der Woude >CON
  7. ECHO http://www.robvanderwoude.com >CON
  8. ECHO.>CON
  9. ECHO Gathering data, this may take several minutes . . .>CON
  10. ECHO.>CON
  11. ECHO.
  12.  
  13. Set Counter=0
  14.  
  15. FOR /F "skip=4 tokens=*" %%A IN ('NET USER /DOMAIN ^| FIND /V "The command completed successfully"') DO CALL :ParseUsers %%A
  16. GOTO:EOF
  17.  
  18.  
  19. :ParseUsers
  20. Set FullLine=%*
  21.  
  22. echo Getting details from %1...
  23. SET UserName=%FullLine:~0,24%
  24. start /wait GetUserDetails.bat %UserName%
  25.  
  26.  
  27. echo Getting details for user %1...
  28. SET UserName=%FullLine:~25,24%
  29. start /wait GetUserDetails.bat %UserName%
  30.  
  31.  
  32. echo Getting details from %1...
  33. SET UserName=%FullLine:~50,100%
  34. start /wait GetUserDetails.bat %UserName%
  35.  
  36. set /a Counter = Counter + 3
  37.  
  38. echo.
  39. echo Done!
  40. echo Details to approximately %Counter% users were extracted!
  41. pause
  42.