Page 1 of 1 1
Topic Options
#201160 - 2010-12-14 10:40 PM Remote Registry Read/Write
DStelz Offline
Getting the hang of it

Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
I'm trying to write a simple script that changes a registry on all my servers. It reports back that this registry entry is 1 when it is actually 0 and when I do a write to it, the result is 0, but it doesn't change it from a 0 to a 1.

Any clue what I'm doing wrong?

Here is the snippet that I'm trying to run.

$rc = ReadValue("\\servername\hklm\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}","IsInstalled")

This comes back as 1 even though it's actually 0.

$rc = WriteValue("\\servername\hklm\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}","IsInstalled","1","REG_DWORD")

Comes back with a 0 and doesn't change the value to 1.

Thanks ahead of time.

Top
#201161 - 2010-12-14 10:55 PM Re: Remote Registry Read/Write [Re: DStelz]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Some initial ideas - check the @SERROR result after the read and write calls. In particular, make sure you aren't getting an Access Denied message.

Also, you're writing a DWORD, which is numeric. Don't enclose the value in quotes, which forces the value to be a string.

Couple of other thoughts:
What kind of remote computer?
Is it a 32 or 64 bit O/S?
Is remote-registry disabled by GPO or other security measure?
Does it work when logged in locally?

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201162 - 2010-12-14 11:04 PM Re: Remote Registry Read/Write [Re: Glenn Barnas]
DStelz Offline
Getting the hang of it

Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
Hi Glenn.

Thanks for the quick response.

It's a 2k8r2 64bit vm. I run the readvalue locally and it returns a 1 with operation completed successfully. I look in regedit and it says 0.

Remote Registry is not disabled as I can remote into it from my laptop, but like I said I get the same thing locally. I'm assuming this isn't a Kix issue so I'll see what I can figure out. Thanks for the help.

Top
#201163 - 2010-12-14 11:21 PM Re: Remote Registry Read/Write [Re: DStelz]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
32bit Registry Entries are contained in "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node" on 64bit Windows.... you might look there to verify if it is there or not.
Top
#201169 - 2010-12-15 04:03 PM Re: Remote Registry Read/Write [Re: Allen]
DStelz Offline
Getting the hang of it

Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
This is for IE ESC so it's a 64 bit setting. When I physically change it in the registry, it works, but I can't get Kix to change it for me.
Top
#201170 - 2010-12-15 04:45 PM Re: Remote Registry Read/Write [Re: DStelz]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Yes, but Kix is 32-bit and is reading the "reflected" values. Read the manual for SetOption and follow the link there. Also look at the README file included in the Kix download as it discribes a setting similar to Wow64FileRedirection that relates to the registry. You'll likely need to turn it OFF to change 64-bit settings.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201172 - 2010-12-15 05:52 PM Re: Remote Registry Read/Write [Re: Glenn Barnas]
DStelz Offline
Getting the hang of it

Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
Thanks for the clarification Glenn. As soon as I did the SetOption("WOW64AlternateRegView","ON"), it worked.
Top
#201174 - 2010-12-15 06:21 PM Re: Remote Registry Read/Write [Re: DStelz]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
There ya go!

It's important to remember that Kix is the 32b app that needs to control how it accesses files and reg values in a 64b environment.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#201175 - 2010-12-15 10:13 PM Re: Remote Registry Read/Write [Re: Glenn Barnas]
DStelz Offline
Getting the hang of it

Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
Haven't done a lot of scripting on servers for obvious reasons, but will definitely keep that in mind. Thanks again.
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 988 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.07 seconds in which 0.037 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org