How do you count the number of times a program is running on a TS?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how you could query TS to find out how many sessions are using a particular program
For example, what if you wanted to know how many copies of Excel were running on a particular TS
I know about the Query Process command (query process * /server:servername) but what I am looking for is a way to access the functionality of this programatically. For example a VB program that runs and interogates the server and brings back a count of the programs (.exe) that are runnning on the TS
Thanks
 
You could this really easily in batch scripting.

Something like this...

qprocess excel.exe | find /c "excel.exe"

....just replace excel.exe with your applications
executable name.

You could also throw this into a for statement or some
loops to query your servers numerous time for different
application names.

-M
-----Original Message-----
Does anyone know how you could query TS to find out how
many sessions are using a particular program?
For example, what if you wanted to know how many copies
of Excel were running on a particular TS?
I know about the Query Process command (query process
* /server:servername) but what I am looking for is a way
to access the functionality of this programatically. For
example a VB program that runs and interogates the server
and brings back a count of the programs (.exe) that are
runnning on the TS.
 
Thanks very much Matthew! I tried this statement qprocess |find \c "excel.exe" and it worked just as desired
 
Back
Top