Justin-Credible Posted November 30, 2005 Posted November 30, 2005 Does anyone know if its possible to obtain the Client Name (that is, the host name) of a user connected to a terminal server remotely (with a script or command line tool)? You can obtain this information graphically from the Terminal Services Manager snap-in (see screenshot).The Query User command (or QWINSTA) only returns the Session Name.Alternatively, remotely reading the user's %CLIENTNAME% environment variable would work as well.
Justin-Credible Posted December 1, 2005 Author Posted December 1, 2005 Unfortunately, no.The closest thing it gives to client name is session name (RDP-TCP#xx), but I need the actual host name that the client is connected from.
cluberti Posted December 1, 2005 Posted December 1, 2005 You'll probably have to check out the WTS API's on MSDN, then, as that's the only other way I know of getting info from a TS machine.http://www.microsoft.com/msj/1099/terminal/terminal.aspx
Justin-Credible Posted December 1, 2005 Author Posted December 1, 2005 I've tried using those (WTSManager.dll) in a vbs script, and the script works when run from the terminal server itself. But I can't find a way to get the script to work remotely from another computer.Looking through the article I noticed it mentions using "WTSOpenServer( LPTSTR pServerName)" to connect to a different server, but I haven't had luck getting it to work yet.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now