VMware

VMware View 3.1 Available Now | Main | View Thin Client Feature Matrix

05/27/2009

VMware View - Client Information Variables


Among the many cool things you can do with View 3.1 is the ability to pass information about the client into the VM. You can now pass the client name, IP address and MAC into the VM. A big thank you to Todd D for all the heavy lifting with this post!

This information is sent to the View agent running in the VM and is stored in the registry.

HKCU\Volatile Environment
ViewClient_MachineName:
TC01
ViewClient_IP_Address:
10.10.10.1
ViewClient_MAC_Address:
0a:0a:0a:0a:0a:0a

This information can be gathered every time you log in. So if a user changes location you can see that change in the variables. This can be run with the CommandsToRunOnConnect once the VDM_AGENT.ADM template has been configured in your AD and have assigned the polices for CommandToRunOnConnect and/or CommandToRunOnReconnectoption.

Here is an example of how it can be used. Values on the guest VM should be as follows:

HKLM\Software\Policies\VMware, Inc.\Vmware VDM\Agent\Configuration\CommandsToRunOnConnect
Command1=“wscript.exe  c:\reconnectscript.vbs”

HKLM\Software\Policies\VMware, Inc.\VMware VDM\Agent\Configuration\CommandsToRunOnReconnect
Command1=“wscript.exe  c:\reconnectscript.vbs”

Then write the script to look something like the following. The below will pop the information up in a small window:

-------------------------------------------------
Begin Script
-------------------------------------------------
Const HKEY_CURRENT_USER  = &H80000001

Set wmiLocator=CreateObject("WbemScripting.SWbemLocator")
Set wmiNameSpace = wmiLocator.ConnectServer(".", "root\default")
Set objRegistry = wmiNameSpace.Get("StdRegProv")

sPath = "Volatile Environment"

lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClient_Machine_Name", vMachine)
lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClient_IP_Address", vIP)
lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClient_MAC_Address", vMAC)

msgbox "The Remote Device Name is " & vMachine & " @ " & vIP & " (" & vMAC & ") "

-------------------------------------------------
End Script
-------------------------------------------------

The idea is that now I can pass that information to applications that could map things like printers to an actual location that the user in coming in from. The possibilities are endless. Enjoy.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341c328153ef01156fb543f8970c

Listed below are links to weblogs that reference VMware View - Client Information Variables:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Post a comment

About This Blog

  • Deliver rich, personalized virtual desktops to any device with all the benefits of centralized management. The VMware View portfolio of products lets IT run virtual desktops in the datacenter while giving end users a single view of all their applications and data in a familiar, personalized environment on any device at any location.

Subscribe

Categories