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

x
?
Solved

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

Posted on 2014-12-22
3
Medium Priority
?
228 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
[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 Comments
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 2000 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 25

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

Give Your Engineering Team a Productivity Boost

Learn why container technology is so powerful and how it can provide your team with productivity gains and other benefits.

Question has a verified solution.

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

Many CHPs use the buzzword ‘Cloud Hosting’ to sell the idea of reliability. Most consumers have the opinion that cloud hosting is easily scalable and can handle just about anything. Further, most CHPs are not transparent and hide the underlying arch…
As managed cloud service providers, we often get asked to intervene when cloud deployments go awry. Attracted by apparent ease-of-use, flexibility and low computing costs, companies quickly adopt leading public cloud platforms such as Amazon Web Ser…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Both in life and business – not all partnerships are created equal. Spend 30 short minutes with us to learn:   • Key questions to ask when considering a partnership to accelerate your business into the cloud • Pitfalls and mistakes other partners…

721 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