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.

32 lines
742 B

  1. function MYSINK_OnCompleted(iHResult, objErrorObject, objAsyncContext)
  2. {
  3. WScript.Echo ("Done");
  4. }
  5. function MYSINK_OnObjectReady(objObject, objAsyncContext)
  6. {
  7. WScript.Echo (objObject.Name);
  8. }
  9. WScript.Echo("CreateObject");
  10. var locator = WScript.CreateObject("WbemScripting.SWbemLocator");
  11. WScript.Echo("ConnectServer");
  12. var services = locator.ConnectServer();
  13. WScript.Echo("CreateSink");
  14. var sink = WScript.CreateObject("WbemScripting.SWbemSink", "MYSINK_");
  15. WScript.Echo("Sec");
  16. WScript.Echo(services.Security_.ImpersonationLevel);
  17. services.Security_.ImpersonationLevel = 3;
  18. WScript.Echo("InstancesOf");
  19. services.InstancesOfAsync(sink, "Win32_process");
  20. WScript.Echo ("Hanging");