perl+wmi如何获取远程PC(XP系统)的进程信息?

perl+wmi如何获取远程PC(XP系统)的进程信息?

平台:XP-sp2

use Win32;
use Win32::OLE;
#procList.pl


$machine= shift || Win32::NodeName();

$class = "WinMgmts:{impersonationLevel=impersonate}!//$machine";
$wmi = Win32::OLE->GetObject($class);
$plist = $wmi->InstancesOf("Win32_Process");
$~ = PROC_LIST;
write;
$~ = PROC_INF;
$n = 0;
foreach $Proc (Win32::OLE::in( $plist )){
    write;
$n++;
}
print " ===========================\n";
print " -> Processes number : $n <-\n";
print " ===========================";

# -----------------------------------------------------------------------------

format PROC_LIST =
@||| @|||||||||||||||| @||||||
"PID", "Process Name", " Memory"
---- ----------------- --------
.

format PROC_INF =
@||| @<<<<<<<<<<<<<<<< @|||||||
$Proc->{'ProcessID'},$Proc->{'Name'},  $Proc->{'PeakWorkingSetSize'}
.

这样,可以获取本机进程信息。但如何获取远程PC的进程呢?直接把$machine=remote IP;不行哦~需要如何连接remote PC先?
先谢过!
Run this script as domain administrator to access remote host.
or you have previliges to access the remote host just like VBScript
or WMI does in Wnidows.