We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

on
Medium Priority
1,478 Views
Good Morning,
I am not the best at scripting but I need to add some Reg Entries to a Kix Login Script so that it changes existing users.  I am not sure how to get it to write the values but here is what I need to do.

("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run") "ctfmon.exe"=-
("HKEY_CURRENT_USER\Software\Microsoft\CTF") "ShowDeskBand"=dword:00000000

Thanks
Trav
Comment
Watch Question

## View Solution Only

Commented:
Dear tolsonkra,
> egentries to a Kix login script
$loc="Key Path like this "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"$=writevalue($loc,"ScreenSaverIsSecure","1","REG_SZ")$=writevalue($loc,"ScreenSaveActive","1","REG_SZ")$=writevalue($loc,"ScreenSaveTimeOut","300","REG_SZ") This is the way you need to do on the kix. With this model you can check it Cheers! Inba Solutions Architect CERTIFIED EXPERT Commented: Try this:$key = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run"
$rc = WRITEVALUE($key,"ctfmon.exe","-","REG_SZ")

$key = "HKEY_CURRENT_USER\Software\Microsoft\CTF"$rc = WRITEVALUE($key,"Disable Thread Input Manager","00000001","REG_DWORD")$key = "HKEY_CURRENT_USER\Software\Microsoft\CTF"
$rc = WRITEVALUE($key,"ShowDeskBand","00000000","REG_DWORD")

Commented:
Sorry I don't want to screw this up so would this be the way to write it up exactly Pber?  This is to modify profiles in Terminal Services and Kix?

I do have 1 reg entry in the script but I didn't write it (but is needed)  I am just leary on the whole registry thing.

$reg = WRITEVALUE ("HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Client\SuperSocketNetlib\LastConnect", "kra-fs1\cpas", "-33423352:np:\\KRA-FS1\pipe\MSSQL$CPAS\sql\query", "REG_SZ")

Solutions Architect
CERTIFIED EXPERT

Commented:
This works fine for me.

The problem might be with security of the user logging on.  The user must be an administrator to have write access to the key provided.

Commented:
I also caught an error in my post.

("HKEY_CURRENT_USER\Software\Microsoft\CTF") "ShowDeskBand"=dword:00000000

should be

("HKEY_CURRENT_USER\Software\Microsoft\CTF\MSUTB") "ShowDeskBand"=dword:00000000

Solutions Architect
CERTIFIED EXPERT

Commented:
Simple change:

$key = "HKEY_CURRENT_USER\Software\Microsoft\CTF\MSUTB"$rc = WRITEVALUE(\$key,"ShowDeskBand","00000000","REG_DWORD")

Commented:
Is there a way to do it if they are not an administrator?
Solutions Architect
CERTIFIED EXPERT

Commented:
The keys with HKEY_CURRENT_USER will be no issue.

On the Citrix server you load regedit and navigate to the key:
("HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Client\SuperSocketNetlib\LastConnect

Then right click it and select security.  Add the user or group that needs to change this key and grant them write permission.

Solutions Architect
CERTIFIED EXPERT

Commented:
I guess there is no Write option, you would have to give them Full Control.

Be careful doing this.  Modifying permissions in the registry is not really recommended.
Solutions Architect
CERTIFIED EXPERT

Commented:
Woops, that's right click and Permissions.
(:

Commented:
I already have the key working.  I just wasn't sure on how to get the new ones to work.  Thanks.

("HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer\Client\SuperSocketNetlib\LastConnect
Solutions Architect
CERTIFIED EXPERT
Commented:
Not a problem, glad to help.

Not the solution you were looking for? Getting a personalized solution is easy.

Commented:
Pber all went smooth thanks.
##### Thanks for using Experts Exchange.

• View three pieces of content (articles, solutions, posts, and videos)
• Ask the experts questions (counted toward content limit)
• Customize your dashboard and profile