By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
461,955 Members | 735 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 461,955 IT Pros & Developers. It's quick & easy.

How to kill a process on remote machine on some other domain?

shrek123
P: 23
I want to kill some process on remote machine which is on some other domain.
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
  1. use Win32::OLE qw( in );
  2.  
  3. $Machine = "." unless( $Machine = shift @ARGV );
  4. #$Machine =~ s#^[\\/]+## if( $ARGV[0] =~ m#^[\\/]{2}# );
  5.  
  6. $CLASS = "WinMgmts:{impersonationLevel=impersonate, (security)}!\\$Machine";
  7.  
  8. $WMI = Win32::OLE->GetObject( $CLASS ); #|| die "Unable to connect to \$Machine:" . Win32::OLE->LastError();
  9.  
  10. $ProcList = $WMI->InstancesOf( "Win32_Process" );
  11. print $ProcList;
  12.  

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
Sep 4 '07 #1
Share this Question
Share on Google+
1 Reply

shrek123
P: 23
Is there any other way to kill and restart processes on remote machine??

Regards,
Shrek123
Sep 5 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.