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.

28 lines
681 B

  1. <HTML>
  2. <HEAD>
  3. <TITLE>WBEM PerlScript Example</TITLE>
  4. <SCRIPT LANGUAGE="PerlScript">
  5. use OLE;
  6. use Win32::OLE;
  7. sub window_onload()
  8. {
  9. # $loc = Win32::OLE->new("WbemScripting.SWbemLocator");
  10. # $service = $loc->ConnectServer();
  11. $service = $window->locator->ConnectServer();
  12. $service->{Security_}->{ImpersonationLevel}=3;
  13. $process = $service->Get('Win32_Service.Name="Winmgmt"');
  14. $window->document->{all}->info->{innerText} = $process->{DisplayName};
  15. }
  16. </SCRIPT>
  17. </HEAD>
  18. <BODY>
  19. The name of the service is
  20. <SPAN ID="info">
  21. unknown
  22. </SPAN>.
  23. <OBJECT ID="locator" CLASSID="CLSID:76A64158-CB41-11D1-8B02-00600806D9B6"></OBJECT>
  24. </BODY>
  25. </HTML>