Hello everybody, well i've been going at this for days and i'm about to pull all my hair out so if anybody could help me at all that would be great.
So the goal is to use WMI to connect to remote machines to pull the event logs from them.
$host = "a_remote_pc";
$user = "administrator_user";
$pass = "password";
$wmiLocator = new COM("WbemScripting.SWbemLocator");
$objWMIService = $wmiLocator->ConnectServer($host, "root\cimv2", $user, $pass);
$oQuery = $objWMIService->ExecQuery("Select * from Win32_NTLogEvent");
and then here is all the stuff to display it, which is not important right now.
--------------------------------------------------------------------------
so here is the error that i get:
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> SWbemLocator<br/><b>Description:</b> Access is denied. ' in c:\Inetpub\wwwroot\wmi\test.php:7 Stack trace: #0 c:\Inetpub\wwwroot\wmi\test.php(7): com->ConnectServer('10.xxx.xxx.xxx', 'root\cimv2', 'administrator_user, 'password') #1 {main} thrown in c:\Inetpub\wwwroot\wmi\test.php on line 7
Line 7 that i refers to is: $objWMIService = $wmiLocator->ConnectServer($host, "root\cimv2", $user, $pass);
and well i'm stuck here.
Also, i created a perl script and it works using perl.... but i need it to work with PHP.
Any help would be appreciated.
Thanks in advance.