#201699 - 2011-03-04 10:54 PM
Registry change
|
CameronSeward
Fresh Scripter
Registered: 2008-07-15
Posts: 13
Loc: Portland, Oregon
|
I am trying to change a value in the registry and I have seen it two different ways but neither seem to work.
This is the two line that I need to change and the two ways I have attempted it. If someone could help that would be great.
#$ = writevalue ('HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent' /v "Use Lightspeed" /t REG_DWORD /d 0 /f) #$ = writevalue ('HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent' /v "TTC Server" /t REG_MULTI_SZ /d ttp.pamplincorp.com /f)
$ReturnCode = AddKey("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent' /v "Use Lightspeed" /t REG_DWORD /d 0 /f") If $ReturnCode = 0 ? "Key added...." Endif
$ReturnCode = AddKey("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent' /v "TTC Server" /t REG_MULTI_SZ /d ttp.pamplincorp.com /f") If $ReturnCode = 0 ? "Key added...." Endif
Thank you, Cameron
|
|
Top
|
|
|
|
#201700 - 2011-03-04 11:54 PM
Re: Registry change
[Re: CameronSeward]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
If I understand what you're trying to enter correctly....Try this...
$null = writevalue ("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent","Use Lightspeed","0","REG_DWORD")
$null = writevalue ("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent","TTC Server","ttp.pamplincorp.com","REG_MULTI_SZ")
|
|
Top
|
|
|
|
#201732 - 2011-03-11 12:12 AM
Re: Registry change
[Re: Mart]
|
AshishS
Fresh Scripter
Registered: 2008-10-27
Posts: 20
|
If your end users are not admin on the local computers, may I suggest making a batch file and call it using runnas with administrator credentials. Thats what I have done in the past however now our end users are local admins so I just code whatever I need done in kix.
|
|
Top
|
|
|
|
#201734 - 2011-03-11 04:21 PM
Re: Registry change
[Re: AshishS]
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
I used to use a program called sanur.exe (runas backwards) combined with the tokenization of the kix scripts using the /t command. It allowed me to pass the password as well as username. It's not a totally secure method by any means, but the scripts were at least obfuscated due to the tokenizing.
http://www.commandline.co.uk/sanur_unsupported/index.html
|
|
Top
|
|
|
|
#201851 - 2011-04-04 10:52 PM
Re: Registry change
[Re: ShaneEP]
|
CameronSeward
Fresh Scripter
Registered: 2008-07-15
Posts: 13
Loc: Portland, Oregon
|
Shane - I attempted to put the two lines into the login.ini file and it still didn't want to go. I am a Enterprise and domain admin and it still doesn't want to change the registry yet the personal folder get mapped. This is what I have in my ini.
[COMMON] ClearPrinterMappings=n ForceVisible=y ClearDriveMappings=y ClearShareConnections=y MinimumDisplayTime=15 BEEP=N $null = writevalue ("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent","Use Lightspeed","0","REG_DWORD") $null = writevalue ("HKEY_LOCAL_MACHINE\SOFTWARE\Lightspeed Systems\SecurityAgent","TTC Server","ttp.pamplincorp.com","REG_MULTI_SZ")
[COMMAND definitions] CLASS=COMMAND PATH=\\pcc-trackit2\TrackIt8\Audit32.exe PRIV=null COMPUTEROUS=!servers,!Domain Controllers,!pamplincom\servers GROUPS=domain users,
[Personal] CLASS=DISK TARGET=P: PATH=\\pmg2svr\%username%$ DESC=Personal Drive
|
|
Top
|
|
|
|
#201853 - 2011-04-04 11:50 PM
Re: Registry change
[Re: Allen]
|
CameronSeward
Fresh Scripter
Registered: 2008-07-15
Posts: 13
Loc: Portland, Oregon
|
Allen - I understand you when you say they don't go in the INI file, the part that I am just not getting is where they should go. You said it should be in the script itself. I am obviously missing something because I thought that was the script. The only other files I have in the Netlogon folder are the KIX32.exe and the kixtart.kix file. Is there another file I should have in there that I don't have that the ini file should be calling to run like I do for our Trackit Audit program? Hopefully your next reply will make a light switch go on for me.
Thank you Cameron
|
|
Top
|
|
|
|
#201855 - 2011-04-05 12:28 AM
Re: Registry change
[Re: Allen]
|
CameronSeward
Fresh Scripter
Registered: 2008-07-15
Posts: 13
Loc: Portland, Oregon
|
OK- I am thinking then that my file is corrupt. This is a small sample of what is in that file.
꼚က쳽ꞅ៘縳癈푆া柏읐鐣콳鄿旔鐇奢ᜆኑ歭ᗾ㴮冤䨝䵶ᢽ꾝쌡ꔚퟘꀆ존矵殩꽂멞ፎ겿憯ퟟ칣큻厈⯦싎됢≤僭됆헮㹿ﶷ䪻륱䣡昙⽍⦠揓Ǹ컠ꋩꎄᤣ㈛돭昗⏂ᅩ䍝쭍賐獾왗٪얟唨㹝ᵂ팁匤뼌桔譖य़䣲䜲茢垐哥週錱ბଣ씔擫牌밉橐滛䫯稃ذ鋛䫡৷伕䑙놷賬ⶑ뚤ڄ昽ନ◆ᬺႬ戗̑㞏玀쵳ㇽ酋➅皸柗꾞눃袳䎴겹몙展㐋ퟡ匮⨄溶탄⧤㹃箫앩㌱醿鄜趻没䙪ᬤ셃ꁔ틴곕堅쥵痬ᵧ窪䪮鍪斍靠命뙂鲅ᰃ惕獨椐搅⇚学壐竽ᐁ씊沞Ꭻဟ慅鉎림舊餋蝏뷢㼿셨ꕾ夐⺞齢૩脮䋶텻癹浲⥣磤쟒墿詯봤鸺種榑握㴻筸栈ゑ䄒ⅻ痋딖㌹眫晑铘煟Ꝥ⸞⼇㸽얗蛵醜瑜댕쌒㷔․ᐤ初仱胠╡箮ﳻㄺ䋂ꔱ跇罡ꀎ뻘鴤⋯䎼钛䩔䙞⼎夌遲洢뾮폷ۈ㜣い勱歶⩈힝捃핛턜뱣꫞ầﶥኖ雏漪團䉂뗸誷◰耭뭔㐨嬞诞ﻱ삡ႂ푅玞欋혟♖ퟬ긗鲒䩱敹饈犱ꉢ뗫ⷢꈙ送ᵛ긣鲩眶
so is there a link you can give me to download the latest version that will be in a English?
Thanks again for you help.
|
|
Top
|
|
|
|
#201859 - 2011-04-05 03:43 PM
Re: Registry change
[Re: Glenn Barnas]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
Cameron,
You can do what you need through a combination of techniques.
First, create a simple Kix script that updates the registry with standard WriteValue() commands. Test it to verify that it works as intended.
VERY IMPORTANT!!! Use Dim to declare all of your variables in your script! You can use the commands that Shane presented earlier. You don't need to set Break On/Off as this is inherited from the main script. If you read the manual, you will see that external scripts that are CALLed are most efficient, but care should be taken to insure your variable names are unique. A simple way to do this is to insert an underscore at either the beginning or end of your var name. For example: $_Null or $Null_. You can view the latest version of the manual on my web site.
Once your script to update registry values has been tested, simply copy it to the NetLogon share where the Kixtart.Kix file is and then edit the LOGIN.INI file, adding the following section:[REG_UPDATE]
CLASS=COMMAND
METHOD=CALL
PATH=regupdate.kix This will run the "regupdate.kix" script by calling it directly from the login script. This eliminates the need to invoke Kix32 again and results in faster processing. It also depends on full variable declarations and no global varname conflicts. See the README.TXT file for a full list of variable and function names used in the script.
The example above runs for all users on all computers. Use the appropriate parameters to control execution by group, OU, computer OU, etc..
Also, the following isn't quite correct:[COMMAND definitions]
CLASS=COMMAND
PATH=\\pcc-trackit2\TrackIt8\Audit32.exe
PRIV=null
COMPUTEROUS=!servers,!Domain Controllers,!pamplincom\servers
GROUPS=domain users, "COMMAND Definitions" should be a unique name, such as "Audit32". Also, PRIV should be either GUEST or ADMIN. If it isn't required, remove it.
Glenn
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1452 anonymous users online.
|
|
|