Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Computer Name of TS Client

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,54847
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Computer Name of TS Client
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Computer Name of TS Client - 1/3/2008 3:19:12 AM   
  dmjones

 

Posts: 5
Score: 0
Joined: 1/3/2008
Status: offline
I'm trying to find a high-integrity method of determining the computer name of a terminal server client.  My working environment is as follows.

HP Thin Clients running Windows XPe connect to HP Blades running Windows XP via RDP.  A user logs into a blade by initiating an RDP session on the Thin Client. A logon script (VBS) runs and reads the HKCU\Volatile Environment\CLIENTNAME registry key on the blade.  This key tends to yeild the computer name of the Thin Client.  Unfortunately, the success is marginal.  From time to time the regisrty key either holds no value or "Console" as it's value instead of the computer name.

I've searched high and low for a resolution to this problem and the concensus seems to be "It can't be done."  I refuse to accept this answer considering I've had success in the past with this method.  Is anyone aware of a similar registry key or method that may yeild a higher success?

Thanks for responding.

- Dan

< Message edited by dmjones -- 1/3/2008 3:23:26 AM >
 
 
Post #: 1
 
 RE: Computer Name of TS Client - 1/3/2008 3:39:16 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
The bad news is that I don't deal with TS so I have no idea for an answer right off the top of my head. The good news is that I spend all day helping people figure out problems that I have no clue about but they do, so I've gotten pretty good at it.

If you were sitting at a machine that was logged in as you described, how would you determine the information that you want? Don't worry about the registry, just describe how Joe user could figure it out.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dmjones)
 
 
Post #: 2
 
 RE: Computer Name of TS Client - 1/3/2008 4:36:36 AM   
  dmjones

 

Posts: 5
Score: 0
Joined: 1/3/2008
Status: offline
Hehe, Joe would look at the Thin Clients' Asset Tag; the sticker on the side of the Thin Client that indicates the computer name.  However...

I failed to mention that I work in the IT dept. as a Desktop Engineer at Northern Michigan Regional Hospital.  The script I'm writing is similar to WTS Locations.  Based on the location of the Thin Client - defined by a local INI file - the script will add and remove network printers in the area.  Because of user ignorance, this must be accomplished with no user interaction.  If they have to click a button or type in a textbox, they will flip-out.

Thanks EB for your attention.

- Dan

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Computer Name of TS Client - 1/3/2008 5:15:40 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
"the sticker on the side of the Thin Client that indicates the computer name"

so the information that you are looking for is linked to the actual hardware? That would make me wonder why it would be anywhere in HKCU.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dmjones)
 
 
Post #: 4
 
 RE: Computer Name of TS Client - 1/3/2008 7:32:33 AM   
  dmjones

 

Posts: 5
Score: 0
Joined: 1/3/2008
Status: offline
The way we track computer assets is by assigning them a number (B-105387).  For UNC and other networking purposes, we use this asset number as the computer name.  RDP is supposed to write the tsclient name to HKCU\...\CLIENTNAME.  Sometimes it does, sometimes it doesn't. That's to be expected from Microsoft. 

(in reply to ebgreen)
 
 
Post #: 5
 
 RE: Computer Name of TS Client - 1/3/2008 7:35:48 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
Where does RDP get the information?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dmjones)
 
 
Post #: 6
 
 RE: Computer Name of TS Client - 1/3/2008 7:41:33 AM   
  dmjones

 

Posts: 5
Score: 0
Joined: 1/3/2008
Status: offline
That's a question for Microsoft.

(in reply to ebgreen)
 
 
Post #: 7
 
 RE: Computer Name of TS Client - 1/3/2008 7:46:20 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
Ok, if this were my problem to solve, I would do two things. First log on and verify that HKCU\Volatile Environment\CLIENTNAME is populated properly. Then search the registry for the same value as what is in HKCU\Volatile Environment\CLIENTNAME.

Next on the same machine I would explore WMI to see if there is a class that holds the same information.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dmjones)
 
 
Post #: 8
 
 RE: Computer Name of TS Client - 1/3/2008 8:15:11 AM   
  dmjones

 

Posts: 5
Score: 0
Joined: 1/3/2008
Status: offline
Yeah...

That's what I was hoping someone would know. 

Thanks for your attention.

(in reply to ebgreen)
 
 
Post #: 9
 
 RE: Computer Name of TS Client - 1/3/2008 8:40:11 AM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
Like ebgreen suggested, take a look a WMI classes to see if any of them show you the information you're after.  You can find a list of TS related classes here: http://msdn2.microsoft.com/en-us/library/aa383515%28VS.85%29.aspx

If we knew off the top of our heads how to get the information you're after....it would have already been posted.

more info:  http://technet2.microsoft.com/windowsserver/en/library/2955fe3f-747e-46a6-8825-eb9eb7baacae1033.mspx?mfr=true

< Message edited by dm_4ever -- 1/3/2008 8:57:11 AM >


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dmjones)
 
 
Post #: 10
 
 RE: Computer Name of TS Client - 1/4/2008 3:18:43 AM   
  mcds99


Posts: 433
Score: 4
Joined: 2/28/2006
Status: offline
I'm guessing these are IP devices using ethernet to connect to the network.

Get the IP address and get the DNS name.
Use the login script to gather the information.

Store the information in a shared place that everyone has access to.
You could have the script collect the user name, use that as the file name and append connection data to the file.
Collect these
  User Name
  IP Address
  DNS Name

Or just look in the security event log.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 11
 
 RE: Computer Name of TS Client - 1/4/2008 6:23:17 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
Wouldn't this be easier?

Set oShell = CreateObject( "WScript.Shell" )
LocalUserLogin=oShell.ExpandEnvironmentStrings("%UserName%")
TermServer =oShell.ExpandEnvironmentStrings("%ComputerName%")
ClientComp = oShell.ExpandEnvironmentStrings("%ClientName%")

_____________________________

Rischip
Author of - The Grim Linker

(in reply to dmjones)
 
 
Post #: 12
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Computer Name of TS Client Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts