Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for wmimonitorid_php

(view source code of wmimonitorid_php as plain text)

  1. <?php
  2. $wmi_object    = new COM( "winmgmts://./root/WMI" );
  3. $wmi_instances = $wmi_object-<ExecQuery( "SELECT * FROM WmiMonitorID" );
  4.  
  5. foreach ( $wmi_instances as $instance ) {
  6. 	print( "Active                 : {$instance->Active}\n" );
  7. 	print( "InstanceName           : {$instance->InstanceName}\n" );
  8. 	print( "ManufacturerName       : " );
  9. 	if ( $instance->ManufacturerName ) {
  10. 		foreach ( $instance->ManufacturerName as $value ) {
  11. 			print( "{$value};" );
  12. 		}
  13. 	}
  14. 	print( "\n" );
  15. 	print( "ProductCodeID          : " );
  16. 	if ( $instance->ProductCodeID ) {
  17. 		foreach ( $instance->ProductCodeID as $value ) {
  18. 			print( "{$value};" );
  19. 		}
  20. 	}
  21. 	print( "\n" );
  22. 	print( "SerialNumberID         : " );
  23. 	if ( $instance->SerialNumberID ) {
  24. 		foreach ( $instance->SerialNumberID as $value ) {
  25. 			print( "{$value};" );
  26. 		}
  27. 	}
  28. 	print( "\n" );
  29. 	print( "UserFriendlyName       : " );
  30. 	if ( $instance->UserFriendlyName ) {
  31. 		foreach ( $instance->UserFriendlyName as $value ) {
  32. 			print( "{$value};" );
  33. 		}
  34. 	}
  35. 	print( "\n" );
  36. 	print( "UserFriendlyNameLength : {$instance->UserFriendlyNameLength}\n" );
  37. 	print( "WeekOfManufacture      : {$instance->WeekOfManufacture}\n" );
  38. 	print( "YearOfManufacture      : {$instance->YearOfManufacture}\n" );
  39. 	print( "\n" );
  40. }
  41. ?>

page last modified: 2022-10-20