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);

	for(int i=0; i<keys->Length;; 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 –

For detailed information on Location Awareness in VMWare view refer to


Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s