Solved

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

Posted on 2013-10-23
5
2,587 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 24

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

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…
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…

896 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

11 Experts available now in Live!

Get 1:1 Help Now