UAG Socket Forwarder on Windows 7x64 and RDP Tunnel

I got a case few days ago about UAG SP2 Socket forwarder not working and fails to launch the mstsc on windows 7 x64 bit client. I wasnt sure about it because as we know windows 7 x64 SF support got enabled with UAG update 2 release https://support.microsoft.com/kb/2288900 .

So the problem scenario was as follows:

When you publish RDP tunnel application on UAG portal and on template if you change the Tunnel application setting from port forwarding to Socket forwarding , mstsc fails to launch.

UAG out of box RDP Windows XP/Vista Tunnel application template looks like :

  <exec exe="mstsc.exe -w:%HRes% -h:%VRes% -v:%leadserver%" flags="4" param="" use-with-lsp="only" />

While working with this issue in lab I noticed that when we enable SF on RDP tunnel App the application calls mstsc.exe from %systemRoot%\system32 directory and that is causing a problem. It should be called from %SystemRoot%\SysWoW64 directory as we need to launch 32 bit app .

 If you go to %SystemRoot%\system32 and rename mstsc.exe to mstsc.exe.bak or any random extension and then go close the browser and launch this app again after new logon session, it will launch the tunnel successfully because this will now invoke mstsc.exe from SysWoW64 directory.

 Note:

 To rename the mstsc in system32 you might be prompted for permissions:

 Browse to %SystemRoot%\System32

Right click mstsc.exe and choose Properties

Go to the Security tab

Click Advanced

Go to the Owner tab

Click Edit

From the “Change owner to:” list, choose your user name

Click OK

Go to the Permissions tab

Click Change Permissions…

Click Add

Enter your user name and click OK

Tick the box in the Allow column for Full control

Click OK

Click OK

A Windows Security warning will come up; click Yes to proceed

Click OK

So to me it looks like the two instances of mstsc.exe onWindows 7 x64 , one in %SytemRoot%\system32 and second in %SytemRoot%\sysWoW64 is causing the confusion.

Another approach is to publish a generic enhanced application for 64 bit clients which launches the MSTSC from %SystemRoot%\SysWoW64