Find users logged on with Terminal Server sessions?

  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

I am trying to find a way to enumerate all the logged on users on Windows systems. I have used WMI to find the local user session if there is one on any windows machine, but I also want to find any users logged on via Terminal sessions on Windows 2003 Terminal Servers.

I have also used WMI to get all the users who have sessions open, but this includes people who've just used a file share like \\server\share\filename.ext.

Does anyone know how I can programmatically (or via cmd) find out the users that have Terminal Server Sessions?
  • crashdan
  • Student
  • Student
  • crashdan
  • Posts: 76

Post 3+ Months Ago

Have you looked at Terminal Services Manager under administrative tools? It doesn't enumerate them but tells you who is logged in or not
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

humbletech99 wrote:
Does anyone know how I can programmatically (or via cmd) find out the users that have Terminal Server Sessions?
  • Melvinchi
  • Novice
  • Novice
  • Melvinchi
  • Posts: 19
  • Loc: Rush City, MN

Post 3+ Months Ago

Here is the commands for the Term Service.
http://technet2.microsoft.com/windowsserver/en/library/552ed70a-208d-48c4-8da8-2e27b530eac71033.mspx?mfr=true

If your looking to make a program to do this i would really look into the .NET framework.

If I'm miss understanding the question please let me know.

Melvinchi
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

thanks for that, I'm looking to do this in ideally vbs, I don't want to get too deep and spend too long on it, I just want to write something to works.
  • crashdan
  • Student
  • Student
  • crashdan
  • Posts: 76

Post 3+ Months Ago

humbletech99 wrote:
I am trying to find a way to enumerate all the logged on users on Windows systems. I have used WMI to find the local user session if there is one on any windows machine, but I also want to find any users logged on via Terminal sessions on Windows 2003 Terminal Servers.
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

crashdan: I can see how you might have thought I meant to use Terminal Server manager, but I did reiterate that I wanted to do this programmatically and there was also the clue with WMI which is always used in programming.

Thanks for trying to help though, I think we've had enough quoting now though, it's not that productive...
  • crashdan
  • Student
  • Student
  • crashdan
  • Posts: 76

Post 3+ Months Ago

just tryin to tell you the way I do it
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

yes but I am not trying to click through to see users, I need it done programmatically. If it was just a matter of opening Terminal Services Manager and having a look, I wouldn't need to ask because I'd know this basic adminstrative tool by the time I have set up a single Terminal Server...
  • jflynn
  • Mastermind
  • Mastermind
  • User avatar
  • Posts: 2305
  • Loc: Baker City, Oregon

Post 3+ Months Ago

not sounding very HUMBLEtech99 for people trying to help you
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

I'm extremely short on time, sorry if I came across harsh. Thanks for trying. Didn't read the question though...
  • clydem
  • Novice
  • Novice
  • clydem
  • Posts: 23

Post 3+ Months Ago

humbletech99 wrote:
I am trying to find a way to enumerate all the logged on users on Windows systems. I have used WMI to find the local user session if there is one on any windows machine, but I also want to find any users logged on via Terminal sessions on Windows 2003 Terminal Servers.

I have also used WMI to get all the users who have sessions open, but this includes people who've just used a file share like \\server\share\filename.ext.

Does anyone know how I can programmatically (or via cmd) find out the users that have Terminal Server Sessions?






Maybe try this:

Right My Computer, click manage, expand shared folders, and go to sessions, you need to do this on the server, if you have domain admin preveleges, you can do this on your local machine, just right-click computer management... just above the sessions, connect to another pc/server, using an ipaddress, let me know if this is helpfull
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

I guess you didn't read the thread properly either and thought that I didn't know what a windows computer was.

I need to find the users programmatically, not graphically. ie. WMI, VBS etc etc...
  • mothbitten
  • Born
  • Born
  • mothbitten
  • Posts: 1

Post 3+ Months Ago

I stumbled across this page when doing a google search for the same thing and found an answer that works for me elsewhere. Doubtless the original poster has moved on to other things, but for those of you wanting a command line way to see terminal server users, it is available via this command (on win2003 at least):
Code: [ Select ]
query session
  • humbletech99
  • Proficient
  • Proficient
  • User avatar
  • Posts: 300

Post 3+ Months Ago

This is a reasonable way to do it with Terminal Servers, getting a script to parse the output, as long as the output doesn't change.

Technically the primary focus is for terminal servers which come with this cli tool, however I'm also interested in non-terminal servers if anyone has any ideas on that too.

Thanks for the feedback.

Post Information

  • Total Posts in this topic: 15 posts
  • Users browsing this forum: No registered users and 49 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.