In another thread there was already a discussion about how to determine a list of all current users on a Windows Terminal Server. I have a somehow different, but complementary question:
I want to prevent a RDP user to run a certain program on the terminal server more than once at a time. Now, if I check the number of instances of that program on the terminal server, it returns the number of all instances currently running, i.e. for all RDP users. A solution would be to look not only for the number of instances, but additionally for the user name for every running instance of that program in order to determine whether the program is already running under a specific user or not. How to accomplish this?
Any recommendation is greatly appreciated.