Solved

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

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

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 25

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

Create Professional Looking Email Signatures

Create "Professional HTML Email Signatures" with ease.
7 Day Money Back Guarantee if not 100% Satisfied.
Affordable - Try it out for 7 Days Totally Risk Free.
Installers provided for over 45 Email clients.
Both Windows & MAC Supported.
Highly Recommended!

Question has a verified solution.

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

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
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.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

739 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