query wmi remotely with php using -'php,windows,wmi,wmi-query'

query wmi remotely with php  using -'php,windows,wmi,wmi-query'

My current code looks like this:

define ( 'CPU_NAME', 'remote_server' );
$obj = new COM ( 'winmgmts:{impersonationLevel=impersonate}//' . CPU_NAME . '/root/cimv2' );
if ( is_object ( $obj ) ){
     $process = $obj->execquery ( "SELECT * FROM Win32_Process" );

Where would I put the login credentials for the remote_server?
I see that it would take a username and password, but I'm not sure how to implement that.

Any help would be appreciated.

Reference: http://us3.php.net/manual/en/class.com.php

asked Sep 7, 2015 by rajesh
0 votes

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.