Is there a way to determine all of the currently logged on users of a Terminal Server? To be more specific, I want to be able to build a list of the users that appear in Terminal Services Manager at the time that I run my script.
The only possibility that I can see at this point is to search through HKEY_USERS for all of the following registry keys:
or
From there I would just extract the username data that I need.
Anyone know of a better way to enumerate the currently logged on users?
The only possibility that I can see at this point is to search through HKEY_USERS for all of the following registry keys:
Code:
HKEY_USERS\[i]<SID>[/i]\Software\Microsoft\Windows\CurrentVersion\Explorer "Logon User Name" [i]username[/i]
Code:
HKEY_USERS\[i]<SID>[/i]\Volatile Environment "APPDATA" C:\Documents and Settings\[i]username[/i]\Application Data
Anyone know of a better way to enumerate the currently logged on users?