WMI or other technique to obtain window list on remote computer

Posted on 2006-06-06
Last Modified: 2008-03-04
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.


Question by:ScottC1234
    LVL 5

    Expert Comment

    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

    Author Comment

    I can't find an object I can instantiate in vbs that would give me this information. Do you know what I would use?
    LVL 5

    Accepted Solution

    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

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    abstract class with all non abstract mentods 6 58
    scoreUp challenge 14 40
    countAbc challenge 9 35
    White board coding practice 3 35
    Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
    Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now