Leostream client as shell

You can repurpose a Windows desktop into a Leostream terminal by replacing the regular Windows explorer shell (start menu & desktop) with Leostream Connect client.  This is used in a VDI environment.

Change how Windows behaves using a Group Policy Object (GPO). This can be filtered on an AD security group so you can control which users go to which Leostream connection server (useful in a failover to DR scenario). Also, turn off roaming profiles (not required for thin clients).

See Leostream admin guide for Leostream client command line options.

Group Policy setting: User configuration\Administrative Templates\System\Custom User Interface
Policy value: C:\Program Files\LeostreamConnect\LeostreamConnect.exe -address <IP of leostream server here>  -shell -machine *

Also I found I had to set the following registry keys using group policy preferences.  The client preferred these over command line switch.  Do your own testing here, Leostream have probably fixed this in their latest software.

HKLM\Software\Leostream\Leostream Connect\RunAsShell 1 REG_DWORD
HKLM\Software\Leostream\Leostream Connect\AutoDiscover 0 REG_DWORD
HKLM\Software\Leostream\Leostream Connect\ControllerAddress <IP of leostream server here> REG_SZ

Or you can launch a quick and dirty vbScript with logic to select the Live or DR leostream server at logon.  Get the customer user interface policy to run wscript.exe <path to vbscript in the User Logon scripts area of GPO>.  This is useful to give IT a quick way of switching themselves to DR site (to begin failover process for everyone else.)  If the connection broker is down, IT can’t fix the connection broker.

option explicit
' Message box constants http://msdn.microsoft.com/en-us/library/t1ft6yf3(v=vs.84).aspx
dim objShell, intReturn
Set objShell = CreateObject("Wscript.Shell")
intReturn = objShell.Popup("Do you want to connect to DR site?",TIMEOUT_SECONDS, "Switch to DR site", vbYesNo + vbQuestion + vbDefaultButton2)
If intReturn = vbYes Then
' Yes selected - go to DR
LaunchLeostream "dr-leostream.mycompany.com",""
ElseIf intReturn = vbNo Then
' No selected. Default to primary site
LaunchLeostream "leostream.mycompany.com",""
' timed out. Default to primary
LaunchLeostream "leostream.mycomany.com",""
End If
Function LaunchLeostream(strControllerAddress,strControllerIP)
'objShell.Popup "Connecting to " & strControllerAddress,TIMEOUT_SECONDS,"Launching Leostream client", vbOK + vbinformation
' DNS name resolution was unreliable in leostream client so use IP Leostream ticket #2679
setReg "HKLM\Software\Leostream\Leostream Connect\RunAsShell","1","REG_DWORD"
setReg "HKLM\Software\Leostream\Leostream Connect\AutoDiscover","0","REG_DWORD"
if setReg("HKLM\Software\Leostream\Leostream Connect\ControllerAddress",strControllerAddress,"REG_SZ")=true then
objShell.run """C:\Program Files\LeostreamConnect\LeostreamConnect.exe"" -address " & strControllerIP & " -shell -machine *",1,true
msgbox "Failed to configure Leostream registry keys. Check Leostream client is installed"
end if
end function
function setReg(strKey,strData,strType)
on error resume next
objShell.RegWrite strKey,strData,strType
if err.number<>0 then
' msgbox err.description & vbcr & strKey & vbcr & strData & vbcr & strType
end if
on error goto 0
end function

Sorry blogging software wrecked my tabs…
If you want it to be more pretty consider a hypertext application (HTA) or look at product like ThinKiosk

Find more IT Infrastructure tips at www.alexmags.com

Leave a Reply