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:
HKEY_USERS\<SID>\Software\Microsoft\Windows\CurrentVersion\Explorer "Logon User Name" username
HKEY_USERS\<SID>\Volatile Environment "APPDATA" C:\Documents and Settings\username\Application Data
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?
Red Flag Submitted
Thank you for helping keep Tek-Tips Forums free from inappropriate posts. The Tek-Tips staff will check this out and take appropriate action.
Reply To This Thread
Posting in the Tek-Tips forums is a member-only feature.