我正在尝试编写一个脚本来检索我网络上远程主机的 NIC 卡信息。
这是我的查询:
$wmi_networkadapter = $obj->ExecQuery("Select * from Win32_NetworkAdapter WHERE NetConnectionID LIKE 'Local Area Connection'");
这是输出:
foreach ($wmi_networkadapter as $wmi_call) {
//Caption
$Caption = $wmi_call->Caption;
echo "<b>Caption:</b> $Caption<br>";
//MACAddress
$MACAddress = $wmi_call->MACAddress;
echo "<b>MACAddress:</b> $MACAddress df<br>";
}
我可以获取 Mac 地址和标题(NIC 名称),但我不知道如何获取 IP 地址。谢谢!