Solved

Create Short Cuts at Log-in on Citrix Desktops in Load Balanced Environment

Posted on 2014-12-22
3
220 Views
Last Modified: 2014-12-23
Hi,

Our users log into virtual Citrix sessions via thin clients, which load on one of 2 different virtual servers depending on the current load those servers are under at the time the user logs in.  

We are looking for a way to use some type of scripting to create shortcuts on the user desktop, using the actual server they end up connected to, and also their user name as parameters.  

So if user D4141 logged on, and connected up to Server X01, they would get a shortcut that points to M:\X01\D4141\program.exe

Is there a good, reliable way to achieve this goal.
0
Comment
Question by:AD1080
3 Comments
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 40514749
You can use this powershell script to run at startup to create the shortcut on the desktop:

$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$Home\Desktop\ProgramShortcut.lnk")
$server=hostname
$user=[Environment]::UserName

$Shortcut.TargetPath = "M:\$server\$user\program.exe"
$Shortcut.Save()

Open in new window

0
 

Author Closing Comment

by:AD1080
ID: 40515060
Thanks a lot.
0
 
LVL 24

Expert Comment

by:Coralon
ID: 40515853
Although the points are already awarded, I would not use powershell for this.  Powershell requires a number of .net libraries to be loaded, it generally slower for what is effectively a login time solution.  

The same script as a vbscript will execute much more quickly and transparently.
option explicit

dim wshShell, sServerName, sUserName, oShortCut, sUserProfilePath, sProgramPath

set wshShell = CreateObject ("wscript.shell")
sUserName = wshShell.ExpandEnvironmentStrings("%USERNAME%")
sServerName = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%)
sUserProfilePath = wshShell.ExpandEnvironmentStrings("%USERPROFILE%)

set oShortCut = wshShell.CreateShortcut(sUserProfilePath & "\Desktop\MyProgramShortCut.lnk")
oShortCut.TargetPath = "m:\" & sServerName & "\" & sUserName & "\program.exe"
oShortCut.Save()

set wshShell = nothing
set oShortCut  = nothing

Open in new window


And if you want to be 100% sure of it, you would set the script up to read the registry value from HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Desktop" in case of a redirected desktop.

Coralon
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Big data transfers via information superhighways require special attention and protection. Learn more about the IT-regulations of the country where your server is located. Analyze cloud providers and their encryption systems for safe data transit. S…
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

776 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