Solved

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

Posted on 2014-12-22
3
225 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 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 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

Ready to get started with anonymous questions?

It's easy! Check out this step-by-step guide for asking an anonymous question on Experts Exchange.

Question has a verified solution.

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

A customer recently asked me about anti-malware and the different deployment options available for his business. Daily news about cyberattacks, zero-day vulnerabilities, and companies that suffered a security breach made him wonder if the endpoint …
A look into Log Analysis and Effective Critical Alerting.
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…

622 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