Often times we here at VMware get asked, "How do I determine the connecting client system info?". Many times this is asked in conjunction with ThinApp as well. Therefore, I figured I'd post this script here to assist anyone looking for this information - at least in conjunction with ThinApp. ☺
This VBScript sample code (Thanks to Todd Dayton - one of our Desktop Specialists - for providing the meat of the code) will look up and report on the View Client Machine Name (the client computer), the View Client IP Address, and the View Client Mac Address. According to Todd, reading the registry of the virtual desktop directly is the best way to ensure these values are properly obtained.
In the below script I have the data lookup defined in two different ways - one via an NTDLL call (the first part) and the other being a Win32 call (the second part) as often times customers desire to have validation logic such as this embedded into a ThinApp package so the ThinApp packaged app will operate in a certain fashion based upon the scripted outcome of the validation logic. And often times, customers wish to use the View Client info to determine all of this.
The issue with doing an NTDLL registry call via a VBScript within a ThinApp package is, ThinApp doesn't fully support NTDLL registry calls. At least, not properly (yet) - and so one will get various anonymous outcomes when using NTDLL registry calls like the one shown in the scripted example. Therefore, I've provided the below script which shows both ways to gather the View Client info - via an NTDLL registry call and via a Win32 registry call.
As a simple test, drop this code into a ThinApp package, rebuild and execute. From within a ThinApp package, it is very likely you will not get any or all values properly returned in the MSGBOX output for the NTDLL call, but you will get them via the Win32 call - or at least, what they are currently set to within the registry of the View session (NOTE: If the values are not updated, it's not a script issue at that point).
Feel free to download the View Client Machine Name.zip and give it a go.
Hope this helps clarify a few things when you or your customers are building ThinApp packages relying upon the View Client info.