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.

58 lines
2.5 KiB

  1. on error resume next
  2. const wbemPrivilegeCreateToken = 1
  3. const wbemPrivilegePrimaryToken = 2
  4. const wbemPrivilegeLockMemory = 3
  5. const wbemPrivilegeIncreaseQuota = 4
  6. const wbemPrivilegeMachineAccount = 5
  7. const wbemPrivilegeTcb = 6
  8. const wbemPrivilegeSecurity = 7
  9. const wbemPrivilegeTakeOwnership = 8
  10. const wbemPrivilegeLoadDriver = 9
  11. const wbemPrivilegeSystemProfile = 10
  12. const wbemPrivilegeSystemtime = 11
  13. const wbemPrivilegeProfileSingleProcess = 12
  14. const wbemPrivilegeIncreaseBasePriority = 13
  15. const wbemPrivilegeCreatePagefile = 14
  16. const wbemPrivilegeCreatePermanent = 15
  17. const wbemPrivilegeBackup = 16
  18. const wbemPrivilegeRestore = 17
  19. const wbemPrivilegeShutdown = 18
  20. const wbemPrivilegeDebug = 19
  21. const wbemPrivilegeAudit = 20
  22. const wbemPrivilegeSystemEnvironment = 21
  23. const wbemPrivilegeChangeNotify = 22
  24. const wbemPrivilegeRemoteShutdown = 23
  25. set locator = CreateObject("WbemScripting.SWbemLocator")
  26. locator.security_.privileges.Add wbemPrivilegeCreateToken
  27. locator.security_.privileges.Add wbemPrivilegePrimaryToken
  28. locator.security_.privileges.Add wbemPrivilegeLockMemory
  29. locator.security_.privileges.Add wbemPrivilegeIncreaseQuota
  30. locator.security_.privileges.Add wbemPrivilegeMachineAccount
  31. locator.security_.privileges.Add wbemPrivilegeTcb
  32. locator.security_.privileges.Add wbemPrivilegeSecurity
  33. locator.security_.privileges.Add wbemPrivilegeTakeOwnership
  34. locator.security_.privileges.Add wbemPrivilegeLoadDriver
  35. locator.security_.privileges.Add wbemPrivilegeSystemProfile
  36. locator.security_.privileges.Add wbemPrivilegeSystemTime
  37. locator.security_.privileges.Add wbemPrivilegeProfileSingleProcess
  38. locator.security_.privileges.Add wbemPrivilegeIncreaseBasePriority
  39. locator.security_.privileges.Add wbemPrivilegeCreatePagefile
  40. locator.security_.privileges.Add wbemPrivilegeCreatePermanent
  41. locator.security_.privileges.Add wbemPrivilegeBackup
  42. locator.security_.privileges.Add wbemPrivilegeRestore
  43. locator.security_.privileges.Add wbemPrivilegeShutdown
  44. locator.security_.privileges.Add wbemPrivilegeDebug
  45. locator.security_.privileges.Add wbemPrivilegeAudit
  46. locator.security_.privileges.Add wbemPrivilegeSystemEnvironment
  47. locator.security_.privileges.Add wbemPrivilegeChangeNotify, false
  48. locator.security_.privileges.Add wbemPrivilegeRemoteShutdown
  49. set service = locator.connectserver (,"root/scenario26")
  50. service.security_.impersonationLevel = 3
  51. set obj = service.get ("Scenario26.key=""x""")
  52. if err <> 0 then
  53. WScript.Echo Hex(Err.Number), Err.Description
  54. end if