Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.6 KiB

  1. @echo off
  2. setlocal
  3. echo Check the presence of a test user account having SeInteractiveLogonRight
  4. echo Does %USERNAME% (current user) have SeTcbPrivilege?
  5. arights %USERNAME% | findstr /I SeTcbPrivilege
  6. if errorlevel 1 (
  7. echo No
  8. arights %USERNAME% -a9
  9. echo Added SeTcbPrivilege to current user %USERNAME% ...
  10. echo You'll have to logoff/logon ...
  11. pause
  12. later.cmd
  13. )
  14. echo Yes
  15. echo Set an user test name...
  16. for /F %%i in ('buildnum') do set machinename=%%i
  17. set postfix=%machinename%
  18. if "%machinename:~0,-1%"=="EFSTEST" set postfix=%machinename:EFSTEST=%
  19. if "%machinename:~0,-2%"=="EFSTEST" set postfix=%machinename:EFSTEST=%
  20. if "%machinename:~0,-1%"=="CRISDOM" set postfix=%machinename:CRISDOM=%
  21. if "%machinename:~0,-1%"=="SEC1X" set postfix=%machinename:SEC1X=%
  22. if "%machinename:~0,-1%"=="SEC2X" set postfix=%machinename:SEC2X=%
  23. set user=usr%postfix%
  24. echo User test name set to %user% (password will be pass%postfix%)
  25. echo Does this user exist?
  26. arights %user%
  27. if errorlevel 1 (
  28. echo No. Creating one...
  29. net user %user% pass%postfix% /ADD
  30. if errorlevel 1 (
  31. echo net user ... /ADD failed
  32. exit /B %errorlevel%
  33. )
  34. )
  35. echo Does test user %user% have SeInteractiveLogonRight ?
  36. arights %user% | findstr /I SeInteractiveLogonRight
  37. if errorlevel 1 (
  38. echo No. Adding right SeInteractiveLogonRight to user %user%...
  39. arights %user% -a0
  40. if errorlevel 1 (
  41. echo adding rights failed...
  42. exit /B %errorlevel%
  43. )
  44. )
  45. echo Now has.
  46. echo Just check a Logontst for user %user% (password pass%postfix%)...
  47. logontst %user% pass%postfix%
  48. if errorlevel 1 (
  49. echo logontst %user% failed...
  50. ) else (
  51. echo ..succeeded
  52. )
  53. exit /B %errorlevel%