Mar
13

Real Smooth Roaming on Citrix

When you’re using Citrix and want your users to be able to roam smoothly from client PC to client PC, you need to use the Web Interface (WI). When connecting to the WI you can use either a webbrowser or the Program Neigbourhood Agent (PNA).

When the only “application” you provide to your users is a full desktop, and you have Single Signon in place (e.g. a remote desktop with PowerFuse) it can be quiet annoying that users still have to start a full blown internet explorer and then click that one icon to connect to that one application. If you could auto launch the remote desktop and still roam smoothly from PC to PC, you could turn your Workstations into “thin clients”. When using the RES PowerFuse Subscriber, you could auto launch a RES PowerFuse Workspace and use the local resources of the workstation and launch local applications (AutoCAD, Video Conferencing, etc) from the central desktop (for more information see: http://www.ressoftware.com/).

What you could do is copy the link to that application and autostart Internet Explorer with that link. This works well the first time you log on, but when roaming from workstation 1 to workstation 2, your existing session will be pulled towards your new location, and then the link will try to start the application again, resulting in error messages that will confuse your users. The same problem arrises when you change the WI to autolaunch the desktop application…

By using the PNA you prevent users from having to start a browser, but they still have to start the desktop application by hand. When roaming the application gets pulled to the new location without any interference from the user. Since ICA Client 10.1 there’s a way to autolaunch a single application by using the /QLaunch option. Unfortunately this results in the same problem as with a browser when roaming.

Sander Hofman and I came up with this solution:
1 Launch the PNAgent
2 wait for a (roaming) session
3 When no session is detected, start PNAgent with /QLaunch

We’ve put this in the following script:

‘==================================================================================
‘ Smooth.vbs
‘ By Sander Hofman & Edgar van Hoeijen
‘ This script is intended to be used in a Citrix Smooth Roaming environment
‘ where RES PowerFuse and RES Subscriber are used
‘ Please see the RES Inside blog for instructions (http://resinside.blogspot.com)
‘ Version: 1.0 Date: 4 march 2009
‘==================================================================================
lc_launch = “PowerFuse”
ln_timeout = 50
If WScript.Arguments.Count > 0 Then
For ln_count = 0 To WScript.Arguments.Count-1
lc_arg = WScript.Arguments.Item(ln_count)
Select Case Ucase(Left(lc_arg,3))
Case “/?”
lc_explain = “Smooth.vbs”+vbcrlf+vbcrlf
lc_explain = lc_explain + “Syntax:”+vbcrlf
lc_explain = lc_explain + ” Smooth.vbs [/L:
] [/T:Timeout]“+vbcrlf+vbcrlf
lc_explain = lc_explain + “/L: Defines the Citrix published app (Desktop) to launch”+vbcrlf
lc_explain = lc_explain + “If this paramater is not present it defaults to PowerFuse”+vbcrlf
lc_explain = lc_explain + “N.B. This parameter is case sensitive!”+vbcrlf+vbcrlf
lc_explain = lc_explain + “/T: Defines the amount of seconds to wait for an existing”+VbCrLf
lc_explain = lc_explain + “If this paramater is not present it defaults to 5″+vbcrlf
lc_explain = lc_explain + “roaming session before starting the defined published app”+vbcrlf+vbcrlf
lc_explain = lc_explain + “This script is explained on resinside.blogspot.com”+VbCrLf
WScript.Echo lc_explain
Case “/L:”
lc_Launch = Mid(lc_arg,4)
Case “/T:”
ln_timeout = Mid(lc_Arg,4)*10
If ln_timeout < 1 Then
WScript.Echo “Amount of seconds to small!”
WScript.Quit
End If
End Select
Next
End If
Set go_Shell = WScript.CreateObject(“WScript.Shell”)
Set go_locator = CreateObject(“WbemScripting.SWbemLocator”)
Set go_service = go_locator.ConnectServer()
lc_processID= “wfica32.exe”
lc_program = chr(34)+go_Shell.ExpandEnvironmentStrings(“%programfiles%”)+”\Citrix\ICA Client\pnagent.exe”+Chr(34) ln_count = 0
ll_launch = True
go_Shell.Run lc_program
Do Until ln_count=(ln_timeout)
Set lo_Props = go_Service.ExecQuery (“select name, description from Win32_Process where name=’”&lc_processID&”‘”)
If lo_Props.Count > 0 Then

ll_launch = False
Exit Do
End If
WScript.Sleep 100
ln_count = ln_count + 1
Loop
If ll_launch Then go_Shell.Run (lc_program+” /QLaunch “+lc_launch)
Set lo_Props = Nothing
Set go_Service = Nothing
Set go_Locator = Nothing
Set
go_Shell = Nothing

‘==================================================================================

COMMENTS: 3
Jerome Jun 09, 2010

when we use the script, it connects to the disconnected session, but also starts a new session... how can we fix it so that it only connects to the disconnected session? thank you, Jerome.

Martijn Verheijen Feb 05, 2010

Cool script, and works very well.Only one problem, when you want to use the subscriber, the application you just started (your desktop) appears in the taskbar in your session.Is there a way to prevent this from happening?kind regards.Martijn Verheijen

Wolfgang muller Nov 02, 2009

This block of code is really very much self explanatory and I really liked the way of writing the code whom so ever has written it. A great blog in deed.

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
CATEGORIES:
ARCHIVES: