WMI or other technique to obtain window list on remote computer

I'm successfully using WMI to obtain lists of all processes, services, and hardware/os information from all computers in the domain.

What I'd like to do is get a list of all windows on a workstation along with their handle, caption, etc. just like Spy++ gives you. I thought WMI's Win32_Thread class would do it, but it doesn't. Does anyone have any ideas of how I can get a list of windows on remote machines similary to Spy++ ?

Here's a little more background on why I'm doing this. We have a software application that runs on all of the machines in the building. The program I've written allows a user to kill the process on all the workstations its running on (say it's 10:00pm and a backup needs to be done - this will close all the open database tables).

There are certain processes that should not be killed. I can discern what they are by examining the windows caption. If a process has a thread with a specific caption, I would not allow the operator to kill that process remotely. But WMI doesn't yield this information, that I can see.


Who is Participating?
dutchclanConnect With a Mentor Commented:
i would still use the wmi WinMgmts object to read the remote services from the registry, then i would use the shell oject from vbs to kickoff the net start / stop even though this is quick and dirty.

Dont know if there is a list somewhere that you can access using wmi to see the actuall state of an service remotely. localy wmi supports this..

-Regards May
WMI (Windows Management Instumentation) is mainly focused on managing AD and services like exchange.

Try VBS (WSH) and the various API`s available ;-) that should do the trick
ScottC1234Author Commented:
I can't find an object I can instantiate in vbs that would give me this information. Do you know what I would use?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.