$obj = new COM ( 'winmgmts://localhost/root/CIMV2' );
$fso = new COM ( "Scripting.FileSystemObject" );
$wmi_computersystem = $obj->ExecQuery("Select * from Win32_ComputerSystem");
$wmi_bios = $obj->ExecQuery("Select * from Win32_BIOS");
$processor = $obj->ExecQuery("Select * from Win32_Processor");
$PhysicalMemory = $obj->ExecQuery("Select * from Win32_PhysicalMemory");
$BaseBoard = $obj->ExecQuery("Select * from Win32_BaseBoard");
$LogicalDisk = $obj->ExecQuery("Select * from Win32_LogicalDisk");
foreach ( $wmi_computersystem as $wmi_call )
{
$model = $wmi_call->Model;
}
foreach ( $wmi_bios as $wmi_call )
{
$serial = $wmi_call->SerialNumber;
$bios_version = $wmi_call->SMBIOSBIOSVersion;
}
我有上面的代码来获取本地主机信息。它运行良好。我的问题是,要获取远程机器信息,我应该将用户凭据(用户名、域管理员的密码)放在哪里?