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.

35 lines
904 B

  1. <HTML>
  2. <HEAD>
  3. <TITLE>WBEM PerlScript Example</TITLE>
  4. <SCRIPT FOR="mysink" EVENT="OnCompleted(hResult, pErrorObject, pAsyncContext)" LANGUAGE="VBScript">
  5. alert("Completed")
  6. </SCRIPT>
  7. <SCRIPT FOR="mysink" EVENT="OnObjectReady(objObject, objAsyncContext)" LANGUAGE="VBScript">
  8. document.all.info.innerText = objObject.DisplayName
  9. </SCRIPT>
  10. <SCRIPT LANGUAGE="PerlScript">
  11. use OLE;
  12. use Win32::OLE;
  13. sub Document_OnClick()
  14. {
  15. $service = $window->locator->ConnectServer();
  16. $service->{Security_}->{ImpersonationLevel}=3;
  17. $service->GetAsync($window->mysink,'Win32_Service.Name="Winmgmt"');
  18. }
  19. </SCRIPT>
  20. </HEAD>
  21. <BODY>
  22. The name of the service is
  23. <SPAN ID="info">
  24. unknown
  25. </SPAN>.
  26. <OBJECT ID="locator" CLASSID="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6"></OBJECT>
  27. <OBJECT ID="mysink" CLASSID="CLSID:75718C9A-F029-11d1-A1AC-00C04FB6C223"></OBJECT>
  28. </BODY>
  29. </HTML>