I am using Win32::OLE GetObject to do that. But I am getting following error
Error1: When my remote machine is on same domain as of local machine
Win32::OLE(0.1701) error 0x80070005: "Access is denied" after character 0 in
"WinMgmts:{impersonationLevel=impersonate,(securit y)}!\\10.10.230.40"
Error2: when my remote machine is on other domain.
Win32::OLE(0.1701) error 0x80041021: after character 0 in
"WinMgmts:{impersonationLevel=impersonate,(securit y)}!\\workgroup\10.10.230.40"
Expand|Select|Wrap|Line Numbers
- use Win32::OLE qw( in );
- $Machine = "." unless( $Machine = shift @ARGV );
- #$Machine =~ s#^[\\/]+## if( $ARGV[0] =~ m#^[\\/]{2}# );
- $CLASS = "WinMgmts:{impersonationLevel=impersonate, (security)}!\\$Machine";
- $WMI = Win32::OLE->GetObject( $CLASS ); #|| die "Unable to connect to \$Machine:" . Win32::OLE->LastError();
- $ProcList = $WMI->InstancesOf( "Win32_Process" );
- print $ProcList;
After spending long time to solve the problem, what i think is there is some probelm with the moniker string or with the authentication.
for running the program, I use program.pl \10.10.230.40
But i am new to this, any help to solve the problem would be appreciated.
thanks,
Shrek123