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.

87 lines
3.6 KiB

  1. //First pass - on mutable object
  2. WScript.Echo ("************************");
  3. WScript.Echo ("PASS 1 - SWbemObjectPath");
  4. WScript.Echo ("************************\n");
  5. var Path = new ActiveXObject("WbemScripting.SWbemObjectPath");
  6. WScript.Echo ("Expect \"\"");
  7. WScript.Echo (Path.DisplayName);
  8. WScript.Echo ();
  9. Path.DisplayName = "winmgmts:root/cimv2:Win32_Wibble.Name=10,Zip=7";
  10. WScript.Echo ("Expect no security info");
  11. WScript.Echo (Path.DisplayName);
  12. WScript.Echo ();
  13. Path.DisplayName = "winmgmts:{impersonationLevel=impersonate}!root/cimv2:Win32_Wibble.Name=10,Zip=7";
  14. WScript.Echo ("Expect \"{impersonationLevel=impersonate}!\"");
  15. WScript.Echo (Path.DisplayName);
  16. WScript.Echo ();
  17. Path.DisplayName = "winmgmts:{authenticationLevel=connect,impersonationLevel=impersonate}!root/cimv2:Win32_Wibble.Name=10,Zip=7";
  18. WScript.Echo ("Expect \"{authenticationLevel=connect,impersonationLevel=impersonate}!\"");
  19. WScript.Echo (Path.DisplayName);
  20. WScript.Echo ();
  21. Path.DisplayName = "winmgmts:{impersonationLevel=impersonate,authenticationLevel=connect}!root/cimv2:Win32_Wibble.Name=10,Zip=7";
  22. WScript.Echo ("Expect \"{authenticationLevel=connect,impersonationLevel=impersonate}!\"");
  23. WScript.Echo (Path.DisplayName);
  24. WScript.Echo ();
  25. Path.DisplayName = "winmgmts:{authenticationLevel=default}!root/cimv2:Win32_Wibble.Name=10,Zip=7";
  26. WScript.Echo ("Expect \"{authenticationLevel=default}!\"");
  27. WScript.Echo (Path.DisplayName);
  28. WScript.Echo ();
  29. Path.DisplayName = "winmgmts:{authenticationLevel=none}!";
  30. WScript.Echo ("Expect \"{authenticationLevel=none}\"");
  31. WScript.Echo (Path.DisplayName);
  32. WScript.Echo ();
  33. Path.DisplayName = "winmgmts:{authenticationLevel=call}";
  34. WScript.Echo ("Expect \"{authenticationLevel=call}\"");
  35. WScript.Echo (Path.DisplayName);
  36. WScript.Echo ();
  37. Path.DisplayName = "winmgmts:{authenticationLevel=pkt,impersonationLevel=delegate}!";
  38. WScript.Echo ("Expect \"{authenticationLevel=pkt,impersonationLevel=delegate}\"");
  39. WScript.Echo (Path.DisplayName);
  40. WScript.Echo ();
  41. Path.DisplayName = "winmgmts:{authenticationLevel=pktIntegrity,impersonationLevel=identify}";
  42. WScript.Echo ("Expect \"{authenticationLevel=pktIntegrity,impersonationLevel=identify}\"");
  43. WScript.Echo (Path.DisplayName);
  44. WScript.Echo ();
  45. Path.DisplayName = "winmgmts:{authenticationLevel=pktPrivacy,impersonationLevel=identify}!root/default";
  46. WScript.Echo ("Expect \"{authenticationLevel=pktPrivacy,impersonationLevel=identify}\"");
  47. WScript.Echo (Path.DisplayName);
  48. WScript.Echo ();
  49. Path.DisplayName = "winmgmts:{authenticationLevel=pktPrivacy,impersonationLevel=identify}!root/default:__Cimomidentification=@";
  50. WScript.Echo ("Expect \"{authenticationLevel=pktPrivacy,impersonationLevel=identify}\"");
  51. WScript.Echo (Path.DisplayName);
  52. WScript.Echo ();
  53. Path.DisplayName = "winmgmts:{impersonationLevel=anonymous}!";
  54. WScript.Echo ("Expect \"{impersonationLevel=anonymous}\"");
  55. WScript.Echo (Path.DisplayName);
  56. WScript.Echo ();
  57. Path.DisplayName = "winmgmts:{impersonationLevel=anonymous}";
  58. WScript.Echo ("Expect \"{impersonationLevel=anonymous}\"");
  59. WScript.Echo (Path.DisplayName);
  60. WScript.Echo ();
  61. //Second pass - on object path
  62. WScript.Echo ("**************************");
  63. WScript.Echo ("PASS 2 - SWbemObject.Path_");
  64. WScript.Echo ("**************************\n");
  65. var Object = GetObject("winmgmts:win32_logicaldisk");
  66. WScript.Echo ("Expect \"{authenticationLevel=pktPrivacy,impersonationLevel=identify}\"");
  67. WScript.Echo (Object.Path_.DisplayName);
  68. WScript.Echo ();
  69. Object.Security_.ImpersonationLevel = 3;
  70. WScript.Echo ("Expect \"{authenticationLevel=pktPrivacy,impersonationLevel=impersonate}\"");
  71. WScript.Echo (Object.Path_.DisplayName);