Use the below script to kill a process on a remote machine. In this example I’m killing off an instance of outlook.
NB. permissions are required on the remote pc or the script will fail.
‘Start of script :
‘———————————————————-
Remotekill()
‘———————————————————-
Function RemoteKill()
strComputer = “remotepcname”
On Error Resume Next
Set oWMIKill = GetObject(”winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)
Set colPClogin = oWMIKill.ExecQuery _
(”Select * from Win32_Process Where Name = ‘outlook.exe’”)
For Each objProcess in colPClogin
objProcess.Terminate()
Next
Set objProcess = Nothing
Set colKeyacc = Nothing
Set colPClogin = Nothing
Set oWMIKill = Nothing
MsgBox “Kill sent to remote computer”, 64, “Remote Process Kill”
End Function
‘———————————————————-