NSClient++ Help (#1) - WMI Queries, Process Counts, Tying processes to sessions (#327) - Message List
I get the impression that there's a way of querying with WMI to determine the number of active sessions.
We have some applications that have to be run remotely on virtual servers, but occasionally operators will open up too many remote desktop sessions and start the same programs several times.
At the moment I've had some success with counting the number of instances of the applications the operators start using NSClient++. Having said that, though, there are some holes in this approach, like if an operator opens the same two configurations in two sessions as opposed to two different configurations in the same session.
Alternatively counting + determining which session the processes belong to (are they all the same) could be an approach.
How have people gone with using WMI? Reading Microsoft doco on some of the WMI stuff seems to suggest they want people to be using .net, and one needs to extract, enumerate and query stuff in a lot of cases.