KdyerKdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
If you download KiXtart 4 or better, you can "spool" (if you know the machine names) through to write to that key to the Remote Client Desktops. You can download the files from here at http://kixtart.org . Check the link above for "Machine Registrations in AD". It might be a little "techie," but should be able to implement.
jack, if there is only that one value to change, you have been provided with the code many times already. if there is only that one value, you have no need what so ever to user any reg-files but directly use one single writevalue()
Most likely, it's a one-time issue. Under KiXtart 4.x it would be a matter of enumerating the computers with any of the NetView() UDFs, loop through the array and just write to the specified registry key, independent of whether the value is already set correctly or not.
code:
; pseudo-code $comps=COMNetView() for each $comp in $comps $rc=writevalue('\\'+$comp+'\HKEY_LOCAL_MACHINE\...) if @ERROR ? 'Error '+@ERROR+' = '+@SERROR+' on comp '+$comp endif next
_________________________
There are two types of vessels, submarines and targets.
Thanks kdyer i will do the upgrade. To your second post I don't think its a rights issue because I have been writing and testing the script as an admin and a regular user.
Lonkero, In a previous post I listed the code
code:
If ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Lotus Notes","")="" $RC=WriteValue("HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail\Lotus Notes","Lotus Notes","REG_SZ") EndIf
and when I tested it I got the message "script error : error in parameter(s) !. "
yes, like jens said. you removed the ,"" part of the code that was provided to you as silved plat without a reason and then you wonder why there is an error?
well, I quess after this topic you know little more about registry
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
There are a few methods of doing this. Copying and running a .REG file is possible, but it will not update the key either if the user is not a Local Administrator on the computer.
The code that Kent gave you will work during logon for a user that is a Local Administrator. However, as far as speed goes, there is no reason to even check the key if you already KNOW that you want it set to Lotus Notes, just write it every time.
Kents Code:
Revised Code:
Notice how it works with FOUR sections SUBKEY "HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail" ENTRY "" ; Note, a blank value indicates the DEFAULT value EXPRESSION "Lotus Notes" DATA TYPE "REG_SZ"
Another thing you can do is what Jens was saying. On your own workstation create a folder called SCRIPTS. Then under SCRIPTS create a folder called 3 and one called 4 Copy KiXtart v3.6 and your other scripts into the 3 folder. Then download and extract KiXtart v4.21-RC2 http://www.scriptlogic.com/downloads/kix/kix2001_421rc2.zip Then copy the executable files into the 4 folder C:\SCRIPTS\4 Then you can run Administrative scripts from the C:\SCRIPTS\4 folder against remote machines (as long as you have Admin rights on all remote machines) Thus you could locate all remote machines and run scripts on them that will update data directly from your workstation. Then your users woudn't need to have Admin rights for many of your scripts.
NOTE KiXtart v4.x can use HKLM for HKEY_LOCAL_MACHINE
COMNetView is a User Defined Function and can be located here http://www.kixhelp.com/udfs/udf/000201.htm or here (note also that Jens says the code only works for 2000/XP systems but since you said
Now, one thing about the code from Jens, it will run on ANY system where it locates the system and you have Admin Rights, including SERVERS so you might want to modify the code or create some list of SERVERS, then go back and repairs what it did. It would be better to NOT modify anything on a Server if you don't want it that way in the first place though.
If you try the LOGON script using v3.60 of KiXtart you will notice that even if you add the method to SHELL out and run the .REG file if you are not an Admin, you won't be able to update that key.
Oh... FYI, If you have Admin rights on your 2000 Active Directory, you can also accomplish this with GPO as well.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
Introduced when I started COPY/PASTE of different users code.
Jens/Les LOVE ' I on the other hand use " most of the time. I play around some times trying to appease them by using the single, in this case I did a COPY/PASTE from differing code snipets.
Also note this code is NOT tested, but rather hopefully showing the user how it can be done. I'll modify the code above, but the user still should verify/modify as needed.
I should quit trying to use single/double just for the sake of Jens lol
Thanks for pointing out the code error though guys.
NTDOCNTDOC Administrator
Registered: 2000-07-28
Posts: 11628
Loc: CA
No guilt Kent.
You used the double and Jens used the single. I merged your code with Jens and did not really look at it any further. I put the double with the single and should have noticed it.
No harm done, Jack has probably left by now anyways.