KILLING Remote process using wmi script

By abhiramhi ·
strComputer = "abc;def;ghi;jkl;mno"

strDomain = "WOrkgroup"
strUser = InputBox("Enter user name")
strPassword = InputBox("Enter password")

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
For Each machine in strComputer
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
"root\CIMV2", _
strUser, _
strPassword, _
"MS_409", _
"ntlmdomain:" + strDomain)
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'notepad.exe'")
For Each objProcess in colProcessList

The following script is not working to kill remote pcs

can u please help

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Collapse -

First off

by neilb@uk In reply to KILLING Remote process us ...

strComputer isn't a collection. You need to split the line using the split function.

sArray = Split(strComputer, ";")
For each Machine in sArray

I wouldn't bother with the locale or domain in the connection parameters unless you're connecting outside your login domain. You only need user name and password if your account doesn't have the rights.

Collapse -


by abhiramhi In reply to First off

Related Discussions

Related Forums