Solved

Citrix UPM profiles, IE with missing registry entries and logon scripts

Posted on 2013-10-23
5
2,548 Views
Last Modified: 2013-10-27
Hi All !

We are trying to use Internet Explorer 10 with thin clients via Citrix. When the UPM user profile is created some of the registry values aren’t being created so they cannot be given correct settings with group policy.

The issue is better described in:
http://www.conetrix.com/Blog/post/How-to-Make-Group-Policy-Work-with-Citrix-Published-Applications.aspx

Using the /AlternateShellStartup with logon script does work. However to minimize issues is it possible to invoke it only once with each user? With normal desktop you could create a silly check like below:

@echo off
if exist "%USERPROFILE%\Fix_Done" goto _nocreate
type nul> "%USERPROFILE%\Fix_Done"
start /MIN %windir%\system32\runonce.exe /AlternateShellStartup
:_nocreate

However it doesn’t seem to be possible to use environment variables with UPM profiles. Is all hope lost? Any way to invoke /AlternateShellStartup only once to create missing registry entries in UPM profiles?
0
Comment
Question by:TroubledWay
5 Comments
 
LVL 23

Assisted Solution

by:Ayman Bakr
Ayman Bakr earned 100 total points
ID: 39596512
Environment variables should work fine with UPM. I guess the issue addressed with %UserProfile% environment variable is that it addresses C:\users\<user ID> on the server.

A better option is to use the %Username% environment variable, where you will explicitly mention the exact path to the UPM profiles like this:

@echo off
if exist "\\<server name>\<UPM share>\%USERNAME%\Fix_Done" goto _nocreate
type nul> "\\<server name>\<UPM share>\%USERNAME%\Fix_Done"
start /MIN %windir%\system32\runonce.exe /AlternateShellStartup
:_nocreate

Open in new window

There is no way to invoke it once through a script without doing the check above. However, once you know that all your users had it already done (and assuming no more employee join) you can remove the script.

Hope this helps!
0
 
LVL 23

Assisted Solution

by:Dirk Kotte
Dirk Kotte earned 100 total points
ID: 39598190
it is possible to check the registry setting directly.
read the reg with the native app reg.exe

http://www.robvanderwoude.com/ntregquery.php
http://social.technet.microsoft.com/Forums/de-DE/7b76f7cb-899c-4511-a2ab-bc8c9b42fd7d/how-to-read-the-registry-using-batch-file

PS: this is possible with vbs also
0
 
LVL 23

Expert Comment

by:Ayman Bakr
ID: 39598629
There is no way to invoke it once through a script without doing the check above
Maybe I didn't express myself correctly.

I didn't mean that the check in the code above is the only way available. Obviously as Dkotte pointed out you can have other alternative checks.

What I meant is that if you want to ensure that /AlternateShellStartup is only invoked once, it would be inevitable to do the check in the script, whether it is the one you have scripted or whether using reg.exe or any other form of scripting. I was not arguing how to do it; I was arguing that you need to do a form of check to ensure it will not run again if it had previously.

At the end in scripting all roads will lead to Rome!!!
0
 
LVL 23

Accepted Solution

by:
Coralon earned 300 total points
ID: 39599345
I normally just use either a wrapper script, or have a script run in usrlogn.cmd.  (I have a full article on this http://www.experts-exchange.com/Software/System_Utilities/Remote_Access/Citrix/A_9235-How-USRLOGON-CMD-processing-works.html

Something like this should work just fine.

option explicit

dim wshShell, sHasBeenRunKey, bHasBeenRun
set wshShell = CreateObject ("wscript.shell")

sHasBeenRunKey = "HKCU\Software\MyScripts\InitialSetupCheck"

On Error Resume Next
bHasBeenRun = wshShell.RegRead(sHasBeenRunKey)
On Error Goto 0

if bHasBeenRun = "yes" then
	'do nothing
else
	wshShell.Run "runonce.exe /alternateshellstartup", 1, vbFalse
	wshShell.RegWrite sHasBeenRunKey, "yes"
end if


set wshShell = nothing

Open in new window


As a wrapper, you would add a wshShell.Run line before the = nothing line, or you would use this as is in the usrlogn1.cmd script (see the article).

The primary benefit to this method it is tied to the profile and not the home directory.

One thing to be very careful about. you have listed %windir%\system32\runonce.exe /AlternateShellStartup.  In your Citrix environment, there is an excellent chance this will not work (assuming XenApp of some form).  In your XA environment, %windir% is redirected to the home directory\Windows.   If you really want to specify a path, you would use %systemroot%\system32\ instead.

Also, since your default path includes the system32 directory, you don't need to specify the path.

Coralon
0
 

Author Closing Comment

by:TroubledWay
ID: 39604187
Thanks for all the great suggestions!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

David Varnum recently wrote up his impressions of PRTG, based on a presentation by my colleague Christian at Tech Field Day at VMworld in Barcelona. Thanks David, for your detailed and honest evaluation!
Last article we focus in how to VMware: How to create and use VMs TAGs – Part 1 so before follow this article and perform the next tasks, you should read the first article how to create the TAG before using them in Veeam Backup Jobs.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
In this video tutorial I show you the main steps to install and configure  a VMware ESXi6.0 server. The video has my comments as text on the screen and you can pause anytime when needed. Hope this will be helpful. Verify that your hardware and BIO…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now