#32750 - 2002-11-19 02:10 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Used the following and STILL am able to connect to the internet.. What could be causing this? Is their anything that im missing. Any help much appreciated.
code:
IF INGROUP("Administrators") $key="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings" $rtn=writevalue($key,"ProxyEnable","0","REG_DWORD") ? "Net disabled.." $key="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings" $rtn=writevalue($key,"ProxyEnable","0","REG_DWORD") ? "Net disabled.." $rs=WriteValue ("HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "", "REG_SZ") ? "Net disabled.." $rs=WriteValue ("HKEY_LOCAL_MACHINE\Enum\Network\MSTCP\0001\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "", "REG_SZ") ? "Net disabled.."
The odd thing is all of the keys have been updated..
Many thanks
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32751 - 2002-11-19 02:15 PM
Re: Disabling users access by group.
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
don't know your environment: are your running an autoproxy script as it uses different registry values; do you use a proxy at all?; could the pages you see be from the local cache?
|
Top
|
|
|
|
#32752 - 2002-11-19 02:25 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
No proxy script, but their is a volera box that does the web caching, this box acts as the proxy.. Then volera redirects through to our ISP Ill check to see if it is viewing cached only...
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32753 - 2002-11-19 02:48 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
No its getting through on cached/non cached..
Strange..
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32756 - 2002-11-19 04:40 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
YES! It works fine when you type this in manually!
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32757 - 2002-11-19 04:51 PM
Re: Disabling users access by group.
|
Darren_W
Hey THIS is FUN
Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
|
Hi,
The only thing I could think of is the timing of running the script, I generaly exacute the proxy settings after the user has logged in with runonce which is set in the inital script that runs.
eg.
code:
; Once login in sequence complete, i.e. user.dat downloaded to PC, run login1.kix $key="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce" $rtn=writevalue($key,"kix","kix32 \\server\netlogon\login1.kix","reg_sz")
Perhaps this could solve your problem?
Darren
_________________________
I want to share something with you - the three sentences that will get you through life. Number 1, 'cover for me.' Number 2, 'oh, good idea, boss.' Number 3, 'it was like that when I got here'.
|
Top
|
|
|
|
#32758 - 2002-11-20 01:59 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
I do run the script after log on (also I have this script loading HKEY_CURRENT_USER keys into the reg from a shell successfully) and although it does return a 'key loaded' string it still does not change the reg key!
Ive posted the whole script. code:
SetConsole ("HIDE") IF @USERID="MARGARET.COX" AND @DATE="2002/10/10" PLAY "0g256t 0g4d1047f f 1g8d1175f 1047f 1397f 2g16d1319f 0g4d1047f f 1g8d1175f 1047f 1568f 2g16d1397f 0g4d1047f f 1g8d2093f 1760f 1397f 1319f 2g16d1175f 0g6d1865f f 1g11d1760f 1397f 1568f 3g21d1397f256t 0g 18d 0ffff 2d" ENDIF If @DAY = "Friday" call "c:\windows\cleanup.kix" ENDIF
;---------------------------------------Removes internet access ---------------------------- ;disable proxy IF INGROUP("Administrators") shell "regedit /s c:\windows\disanet.reg" ? "Key loaded" ; this doesnt work! ENDIF IF INGROUP("YEAR8") shell "regedit /s c:\windows\disanet.reg" ENDIF IF INGROUP("YEAR9") shell "regedit /s c:\windows\disanet.reg" ENDIF IF INGROUP("YEAR10") shell "regedit /s c:\windows\disanet.reg" ENDIF IF INGROUP("YEAR11") shell "regedit /s c:\windows\disanet.reg" ENDIF ;------------------- Deletes Key First---------------------------- $rmv = DelKey("HKEY_CURRENT_USER\Identities") If $rmv = 0 ? "Key deleted..." Endif ;----------------- loadKey from c: --------------------------------------------- shell "regedit /s c:\windows\outlook.reg" ? "key loaded" ; works fine!
;----------------- loadKey from c: --------------------------------------------- shell "regedit /s c:\windows\internet.reg" ? "key loaded"
$hidedrv="HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies" IF (WriteValue("$hidedrv"+"\Explorer","NoDrives","8650812",REG_DWORD) <> 0) ? "Warning "@error+": "@serror ENDIF $pubsve="HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Publisher" IF (WriteValue("$pubsve","DefaultPath","H:","REG_SZ") <> 0) ENDIF ;----------------------------- Showing Username in Internet Exp--------------------------------------------- $rs=WriteValue ("Software\Microsoft\Internet Explorer\PageSetup", "header", "@FULLNAME&bPage &p of &P", "REG_SZ") $rs=WriteValue ("Software\Microsoft\Internet Explorer\PageSetup", "footer", "&u", "REG_SZ") ;------------------------------ Inserting Fullname and email address in outlook----------------- $rs=WRITEVALUE ("Identities\{00000001-0000-0000-0000-000000000000}\Software\Microsoft\Internet Account Manager\Accounts\00000002", "SMTP Display Name", "@FULLNAME", "REG_SZ") $add=@USERID+"@@HOLTE.BHAM.SCH.UK" IF(WriteValue("Identities\{00000001-0000-0000-0000-000000000000}\Software\Microsoft\Internet Account Manager\Accounts\00000002", "SMTP Email Address", "$add", "REG_SZ") <> 0) ENDIF ;----------------------- Setting favorites --------------------------------------------- IF (WRITEVALUE("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Favorites","H:\MyWork\AppData\Favorite","REG_SZ") <> 0) ENDIF cd windows shell "%comspec% /c deltree /Y c:\windows\*.bmp" ; - homepage - $ikey="HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main" IF (ExistKey($ikey) = 0) IF ($debug_mode = "yes") ? "input -> ["+$ikey+"]" ENDIF ; $default_start_page="http://www.holte.bham.sch.uk" ; - set it to your homepage - $ikey_ex="Start Page" $ivalue=ReadValue($ikey, $ikey_ex) IF (ExistKey($ikey+"\"+$ikey_ex) = 0) $result_data_type=ReadType($ikey, $ikey_ex) ELSE $result_data_type="REG_SZ" ENDIF IF ($debug_mode = "yes") ? " "+$ikey_ex+"="+ReadValue($ikey, $ikey_ex)+" "+ReadType($ikey, $ikey_ex) ENDIF IF ($ivalue <> $default_start_page) IF (writevalue($ikey, $ikey_ex, $default_start_page, $result_data_type) = 0) IF (writevalue($ikey, $ikey_ex, $default_start_page, "REG_SZ") = 0) ENDIF $info=$info+" IExplorer.Start_Page[old]=('"+$ivalue+"' > '"+$default_start_page+"')" ENDIF ENDIF ENDIF ? "Update completed. Result: "+$info cookie1 EXIT
Its a shame because im so close to getting this to work!! [ 20. November 2002, 14:01: Message edited by: Howard Bullock ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32760 - 2002-11-20 02:42 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
This is bizzarre!! Ive exported the key before doing this ive manually disabled the ProxyServer (set it to value 0) exported this to the root of C:\ (called it disanet.reg) the branch being, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings. Ive then run the following (after manually deleting the branch!) code:
;disable proxy IF INGROUP("Administrators") $rmv = DelKey("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings") If $rmv = 0 ? "Key deleted..." Endif shell "regedit /s c:\disanet.reg" ? "Key loaded" ENDIF
If I load this key through the script it sets the value of ProxyServer to 1 if I merge the key manually (by right clicking on it) it does excactly what I want and sets it to 0... Im going mad!!!
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32761 - 2002-11-20 02:55 PM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Since posting the last post I noticed I had put an addional endif in the script ive since taken this out and it still is behaving in the same way...
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
#32763 - 2002-11-22 10:23 AM
Re: Disabling users access by group.
|
Stephen Wintle
Seasoned Scripter
Registered: 2001-04-10
Posts: 444
Loc: England
|
Thanks for everybodies help, I managed to get it working in the end. The problem was I was trying to run the Ingroup function using global groups in a 9x environment (I had to create a few local groups for each of my year groups is all!) It pays to read the manuall!!!
Cheers
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(mole)
and 405 anonymous users online.
|
|
|