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.

97 lines
3.6 KiB

  1. on error resume next
  2. while true
  3. 'First pass - on mutable object
  4. WScript.Echo "************************"
  5. WScript.Echo "PASS 1 - SWbemObjectPath"
  6. WScript.Echo "************************"
  7. WScript.Echo ""
  8. Set Path = CreateObject("WbemScripting.SWbemObjectPath")
  9. WScript.Echo "Expect """""
  10. WScript.Echo """" & Path.DisplayName & """"
  11. WScript.Echo ""
  12. Path.DisplayName = "winmgmts:root/cimv2:Win32_Wibble.Name=10,Zip=7"
  13. WScript.Echo "Expect no security info"
  14. WScript.Echo Path.DisplayName
  15. WScript.Echo ""
  16. Path.DisplayName = "winmgmts:{impersonationLevel=impersonate}!root/cimv2:Win32_Wibble.Name=10,Zip=7"
  17. WScript.Echo "Expect ""{impersonationLevel=impersonate}!"""
  18. WScript.Echo Path.DisplayName
  19. WScript.Echo ""
  20. Path.DisplayName = "winmgmts:{authenticationLevel=connect,impersonationLevel=impersonate}!root/cimv2:Win32_Wibble.Name=10,Zip=7"
  21. WScript.Echo "Expect ""{authenticationLevel=connect,impersonationLevel=impersonate}!"""
  22. WScript.Echo Path.DisplayName
  23. WScript.Echo ""
  24. Path.DisplayName = "winmgmts:{impersonationLevel=identify,authenticationLevel=call}!root/cimv2:Win32_Wibble.Name=10,Zip=7"
  25. WScript.Echo "Expect ""{authenticationLevel=call,impersonationLevel=identify}!"""
  26. WScript.Echo Path.DisplayName
  27. WScript.Echo ""
  28. Path.DisplayName = "winmgmts:{authenticationLevel=default}!root/cimv2:Win32_Wibble.Name=10,Zip=7"
  29. WScript.Echo "Expect ""{authenticationLevel=default}!"""
  30. WScript.Echo Path.DisplayName
  31. WScript.Echo ""
  32. Path.DisplayName = "winmgmts:{authenticationLevel=none}!"
  33. WScript.Echo "Expect ""{authenticationLevel=none}"""
  34. WScript.Echo Path.DisplayName
  35. WScript.Echo ""
  36. Path.DisplayName = "winmgmts:{authenticationLevel=call}"
  37. WScript.Echo "Expect ""{authenticationLevel=call}"""
  38. WScript.Echo Path.DisplayName
  39. WScript.Echo ""
  40. Path.DisplayName = "winmgmts:{authenticationLevel=pkt,impersonationLevel=delegate}!"
  41. WScript.Echo "Expect ""{authenticationLevel=pkt,impersonationLevel=delegate}"""
  42. WScript.Echo Path.DisplayName
  43. WScript.Echo ""
  44. Path.DisplayName = "winmgmts:{authenticationLevel=pktIntegrity,impersonationLevel=identify}"
  45. WScript.Echo "Expect ""{authenticationLevel=pktIntegrity,impersonationLevel=identify}"""
  46. WScript.Echo Path.DisplayName
  47. WScript.Echo ""
  48. Path.DisplayName = "winmgmts:{authenticationLevel=pktPrivacy,impersonationLevel=identify}!root/default"
  49. WScript.Echo "Expect ""{authenticationLevel=pktPrivacy,impersonationLevel=identify}"""
  50. WScript.Echo Path.DisplayName
  51. WScript.Echo ""
  52. Path.DisplayName = "winmgmts:{authenticationLevel=pktPrivacy,impersonationLevel=identify}!root/default:__Cimomidentification=@"
  53. WScript.Echo "Expect ""{authenticationLevel=pktPrivacy,impersonationLevel=identify}"""
  54. WScript.Echo Path.DisplayName
  55. WScript.Echo ""
  56. Path.DisplayName = "winmgmts:{impersonationLevel=anonymous}!"
  57. WScript.Echo "Expect ""{impersonationLevel=anonymous}"""
  58. WScript.Echo Path.DisplayName
  59. WScript.Echo ""
  60. Path.DisplayName = "winmgmts:{impersonationLevel=anonymous}"
  61. WScript.Echo "Expect ""{impersonationLevel=anonymous}"""
  62. WScript.Echo Path.DisplayName
  63. WScript.Echo ""
  64. 'Seconc pass - on object path
  65. WScript.Echo "**************************"
  66. WScript.Echo "PASS 2 - SWbemObject.Path_"
  67. WScript.Echo "**************************"
  68. WScript.Echo ""
  69. Set Object = GetObject("winmgmts:win32_logicaldisk")
  70. WScript.Echo "Expect ""{authenticationLevel=pktPrivacy,impersonationLevel=identify}"""
  71. WScript.Echo Object.Path_.DisplayName
  72. WScript.Echo ""
  73. Object.Security_.ImpersonationLevel = 3
  74. WScript.Echo "Expect ""{authenticationLevel=pktPrivacy,impersonationLevel=impersonate}"""
  75. WScript.Echo Object.Path_.DisplayName
  76. if err <> 0 then
  77. WScript.Echo Err.Description, Err.Number, Err.Source
  78. end if
  79. wend