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.

53 lines
1.4 KiB

  1. on error resume next
  2. Set ObjectPath = CreateObject("WbemScripting.SWbemObjectPath")
  3. ObjectPath.Server = "hah"
  4. ObjectPath.Namespace = "root/default/something"
  5. ObjectPath.Class = "ho"
  6. ObjectPath.Keys.Add "fred1", 10
  7. ObjectPath.Keys.Add "fred2", -34
  8. ObjectPath.Keys.Add "fred3", 65234654
  9. ObjectPath.Keys.Add "fred4", "Wahaay"
  10. ObjectPath.Keys.Add "fred5", -786186777
  11. if err <> 0 then
  12. WScript.Echo err.number
  13. end if
  14. WScript.Echo "Pass 1:"
  15. WScript.Echo ObjectPath.Path
  16. WScript.Echo ObjectPath.DisplayName
  17. WScript.Echo ""
  18. ObjectPath.Security_.ImpersonationLevel = 3
  19. WScript.Echo "Pass 2:"
  20. WScript.Echo ObjectPath.Path
  21. WScript.Echo ObjectPath.DisplayName
  22. WScript.Echo ""
  23. ObjectPath.Security_.AuthenticationLevel = 5
  24. WScript.Echo "Pass 3:"
  25. WScript.Echo ObjectPath.Path
  26. WScript.Echo ObjectPath.DisplayName
  27. WScript.Echo ""
  28. Set Privileges = ObjectPath.Security_.Privileges
  29. if err <> 0 then
  30. WScript.Echo Hex(Err.Number), Err.Description
  31. end if
  32. Privileges.Add 8
  33. Privileges.Add 20, false
  34. WScript.Echo "Pass 4:"
  35. WScript.Echo ObjectPath.Path
  36. WScript.Echo ObjectPath.DisplayName
  37. WScript.Echo ""
  38. ObjectPath.DisplayName = "winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktprivacy,(Debug,!IncreaseQuota, CreatePagefile ) }!//fred/root/blah"
  39. WScript.Echo "Pass 5:"
  40. WScript.Echo ObjectPath.Path
  41. WScript.Echo ObjectPath.DisplayName
  42. WScript.Echo ""