Getting Endpoint Device Information within VMware View Desktop


When a connection towards the virtual desktop is establishing the View Agent installed within the VM handles the session management. Client Device Information sent to the View Agent and can be gathered every time user logs in, connect and re-connect.

Client Device Information is changing when user changes location/endpoint.
This information is saved at (HKEY_CURRENT_USER -> Volatile Environment). This registry key contains a collection of values which relates to user’s non-persistent environment variable set.

Code (C++ Managed) to retrieve Endpoint Information


using namespace System;
using namespace Microsoft::Win32;

int main()
{
	RegistryKey^ regkey=Registry::CurrentUser->OpenSubKey("Volatile Environment");
	if(regkey==nullptr) {
		Console::WriteLine("Registry Key not found - aborting");
		return -1;
	}

	Object^ obj;
	array ^keys = gcnew array(4);
	keys[0]="ViewClient_IP_Address";
	keys[1]="ViewClient_MAC_Address";
	keys[2]="ViewClient_Machine_Name";
	keys[3]="ViewClient_Type";

	for(int i=0; i<keys->Length;; i++) {
		obj=regkey->GetValue(keys[i]);
		if(obj!=nullptr) {
			Console::WriteLine(keys[i] + ":" + obj->ToString());
		}
	}
	return 0;
}

Executing the compiled binary from within the View Desktop Session.

To download the code with Visual Studio project files, click here.

With configuring the group policy for CommandToRunOnConnect and CommandToRunOnReConnect we can execute a command to retrieve physical device and network information, and can pass on this information to any location aware application.

In addition, it enables the new way for Single Sign-On (SSO) access based on “where you are”.

For Configuring Group Policy for CommandToRunOnConnect and CommandToRunOnReConnect refer to my previous blog post – https://divyen.wordpress.com/2011/07/02/running-scripts-commands-on-vmware-view-desktop-connect-reconnect/

For detailed information on Location Awareness in VMWare view refer to http://www.vmware.com/files/pdf/VMware-View-4-LocationAwareness-WP-EN.pdf

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s