Hello,
I'm attempting to write a PHP script to query WMI for an IP address of a host. The reason I'm doing this instead of getbyhostname is because NAT translations on the network can cause inaccurate results. The question is two-fold:
1) My Script is as follows
<?
$obj = new COM ( 'winmgmts://localhost/root/CIMV2' );
$wmi_network = $obj->ExecQuery("Select * From Win32_NetworkAdapterConfiguration");
foreach ( $wmi_network as $wmi_call )
{
$ipaddr = $wmi_call->IPAddress;
echo $ipaddr;
}
?>
I get the following error when running the script:
2) How do I go about querying a remote host on the network with valid credentials?
Thank you