JakeBentz

GetSID.cmd

Jul 5th, 2012
214
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. :: /=======================================================================
  3. :: /=
  4. :: /=  GetSID.cmd
  5. :: /=
  6. :: /=  AUTHOR: Jake Bentz
  7. :: /=  DATE:    07/3/2012
  8. :: /=
  9. :: /=  REQUIREMENTS: psgetsid.exe
  10. :: /=
  11. :: /=  REVISION HISTORY
  12. :: /=   VER  DATE        AUTHOR/EDITOR   COMMENT
  13. :: /=   1.0  07/3/2012   Jake Bentz  Created script
  14. :: /=
  15. :: /=======================================================================
  16. setlocal
  17.  
  18. :: -- Set version number
  19. set SCRIPT_VER=1.0
  20. set SYNTAX=Syntax: GetSID.cmd [ServerList]
  21.  
  22. :: -- Check for arguments
  23. :: -- If your script has a simple syntax this is an easy way to present
  24. :: -- help text.
  25. if (%1) EQU (/?) echo %SYNTAX% & goto END
  26. if /i (%1) EQU (/h) echo %SYNTAX% & goto END
  27. if (%1) EQU (?) echo %SYNTAX% & goto END
  28. if (%1) EQU (-?) echo %SYNTAX% & goto END
  29. if /i (%1) EQU (-h) echo %SYNTAX% & goto END
  30.  
  31. :: -- Set variables
  32. if (%1) EQU () echo ERROR: Missing Server List! & echo %SYNTAX% & goto END
  33. set ServerList=%1
  34. set Logfile=GetSidOutput_%ServerList%.txt
  35. goto MAIN
  36. :MAIN
  37.  
  38. echo.>>%LogFile%
  39. for /f %%a in (%ServerList%) do (
  40.     psgetsid \\%%a >> %Logfile%
  41.     )
  42.  
  43. :END
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment