?
Solved

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

Posted on 2013-10-23
5
Medium Priority
?
2,901 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 400 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 24

Assisted Solution

by:Dirk Kotte
Dirk Kotte earned 400 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 25

Accepted Solution

by:
Coralon earned 1200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
August and September have been big months for VMware—from VMworld last month to our new Course of the Month in VMware Professional - Data Center Virtualization. We reached out to Andrew Hancock, resident VMware vExpert, to have a more in-depth discu…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
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…
Suggested Courses

807 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