Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Vmware View Location Awareness

Posted on 2013-06-13
5
Medium Priority
?
1,061 Views
Last Modified: 2013-06-19
Hey Experts,

We are currently using Vmware VDI View with thin clients and the View client but are having difficulties with the Location Awareness piece. Currently we have a View Security server in a DMZ facing the Internet to allow users to connect with the View client and access their desktop from off-site. The same connection server is also available from the inside. The View Security server does not log source IP and username for connections coming in from the outside, which we see as a security flaw. However, the source IP and username are contained within the registry keys in Windows at this location:

HKEY_CURRENT_USER\Volatile Environment.

While referencing this documentation I'm attempting to take the values of these registry keys and output to a text file.

http://www.vmware.com/files/pdf/VMware-View-Location-Awareness-WP-EN.pdf

I have the CommandsToRunOnConnect GPO applied to the VMs with a batch file and VB script in an attempt to grab the values in the registry and either dump to a text file or display on the screen each time a user connects to their VDI.

The problem is that neither one of them works correctly. I know that the scripts are running because I have set the batch file to timeout for 20 seconds and can see it counting down when I reconnect to the desktop. The batch file will not write the registry values to the text file though, and the VBscript will not display on the screen. Both work when run manually.

Batch script
@echo off
timeout 20
echo %computername%/%username%  %time% %date% >>c:\vdi\vmware.txt
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>>c:\vdi\vmware.txt
reg query "HKEY_CURRENT_USER\Volatile Environment" /v "ViewClient_LoggedOn_Username">>c:\vdi\vmware.txt
reg query "HKEY_CURRENT_USER\Volatile Environment" /v "ViewClient_IP_Address">>c:\vdi\vmware.txt
echo.>>c:\vdi\vmware.txt

VB 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, "ViewClien_Machine_Name", vMachine)
lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClien_IP_Address", vIP)
lRC = objRegistry.GetStringValue(HKEY_CURRENT_USER, sPath, "ViewClien_MAC_Address", vMAC)
msgbox "The Remote Device Name is " & vMachine & " @ " & vIP & " (" & vMAC & ") "
0
Comment
Question by:smartytech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 28

Expert Comment

by:asavener
ID: 39248434
What happens if you just run the batch script line items manually?

...are you sure that HKCU is the correct hive for this?
0
 
LVL 28

Accepted Solution

by:
asavener earned 1500 total points
ID: 39248441
0
 

Author Comment

by:smartytech
ID: 39248839
Thanks for the response asavener. Yes, the commands work when run manually. HKCU is the correct location for that information according to Vmware documentation. The KB article you pointed me to looked promising but it didn't change anything. That article also states the problem was fixed in 5.1 and we are currently running View 5.2.

Any other thoughts?
0
 

Assisted Solution

by:smartytech
smartytech earned 0 total points
ID: 39248992
*Update*

I figured out another way to do it that worked. I changed the script to the following since the values of the Volatile Environment keys are written to the environment variables, such as %ViewClient_IP_Address%.

@echo off
timeout 10
echo %computername%/%username%  %time% %date% >>c:\vdi\vmware.txt
echo %ViewClient_IP_Address% >>c:\vdi\vmware.txt
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>>c:\vdi\vmware.txt

The KB article you linked led me down this path. Thanks again!
0
 

Author Closing Comment

by:smartytech
ID: 39258799
Using environment variables in the scripts is what ultimately resolved this.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question