Solved

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The following article is comprised of the pearls we have garnered deploying virtualization solutions since Virtual Server 2005 and subsequent 2008 RTM+ Hyper-V in standalone and clustered environments.
When we have a dead host and we lose all connections to the ESXi, and we need to find a way to move all VMs from that dead ESXi host.
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.
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…

690 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