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?

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)}!\\"

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\"

Expand|Select|Wrap|Line Numbers
  1. use Win32::OLE qw( in );
  3. $Machine = "." unless( $Machine = shift @ARGV );
  4. #$Machine =~ s#^[\\/]+## if( $ARGV[0] =~ m#^[\\/]{2}# );
  6. $CLASS = "WinMgmts:{impersonationLevel=impersonate, (security)}!\\$Machine";
  8. $WMI = Win32::OLE->GetObject( $CLASS ); #|| die "Unable to connect to \$Machine:" . Win32::OLE->LastError();
  10. $ProcList = $WMI->InstancesOf( "Win32_Process" );
  11. 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 \
But i am new to this, any help to solve the problem would be appreciated.

Sep 4 '07 #1
Share this Question
Share on Google+
1 Reply

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

Sep 5 '07 #2

Post your reply

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