Link to home
Start Free TrialLog in
Avatar of dflynn21
dflynn21Flag for United States of America

asked on

Return Clients Hostname on a Terminal Server Using Visual Basic 2005

We are designing an application that requires us to return the hostname of the Client computer that is connecting to our Terminal Server.   Using Visual Basic 2005, what is the best approach for returning this information.


ClientA  ------------------à TSServerB

We are trying to return ClientA using a function that is running on a TSSERVERB Session.
Avatar of rheitzman
rheitzman
Flag of United States of America image

One of the Environment variables is CLIENTNAME.

To verify open a command window (RUN cmd) and type SET.

Not sure what tool you are using but most have a way to get to the environment variables. If you version doesn't provide access the Windows Scripting Host can be referencee and the WSHShell.ExpandEnvironmentStrings used:

    Dim wsh As New WshShell
    Debug.Print wsh.ExpandEnvironmentStrings("%TEMP%")

replace %TEMP% with variable you need.
ASKER CERTIFIED SOLUTION
Avatar of dflynn21
dflynn21
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial