C#, Getting list of logged on Terminal Service Users

G

Guest

Hello,

I am searching for a way to retrieve the list of currently logged on
terminal server users. Not only do I have to know who is currently using a
remote desktop session, but also need to prevent other users from logging in.

I found a way of getting a list of running processes and link them to the
owning users, but there must be a better way... for example, Terminal Server
brings a tool called query.exe which shows the users currently logged in. How
did they do this?

Is there a simple WMI call available for achieving this?

I am looking forward to your suggestions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top