#45781 - 2003-09-22 02:03 PM
DHCP and Internet Explorer
|
vavoom
Lurker
Registered: 2003-09-22
Posts: 3
|
Since we use Windows 2000 I have some troubles with the DHCP clients. I only want the DHCP clients to connect to internet by proxyserver, static ip clients don't use the proxy server. The script below works fine with Windows NT. I cannot figure out, how to get it right for Win2K machines. Can anyone help me out?
; *'Internet Explorer 5.5SP2 Settings for DHCP Clients'* $DHCP=readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCP","Start") If $DHCP = $Dynamicip WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyEnable","00000001","REG_DWORD") WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyServer","PROXYSERVER:80","REG_SZ") WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings","ProxyOverride","","REG_SZ") endif
|
|
Top
|
|
|
|
#45784 - 2003-09-22 02:32 PM
Re: DHCP and Internet Explorer
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
What is $Dynamicip?
If we look at -
code:
If $DHCP = $Dynamicip ...
Kent
|
|
Top
|
|
|
|
#45785 - 2003-09-22 02:39 PM
Re: DHCP and Internet Explorer
|
vavoom
Lurker
Registered: 2003-09-22
Posts: 3
|
$Dynamicip = 2
If I run the script in debug mode, there is no error message. Everything seems to go fine. But when I change the client from DHCP ip to Static ip, the proxy-server still remains at the Internet Explorer 6. Even when I delete the Proxy-server manually, it still comes back at the Static clients. So when the script is checking if the computer is a DHCP-client, it always assumes that it IS a DHCP-client, so I thing there is something wrong.
quote: You may be better off querying the adaptor(s) to see if the address has been statically assigned, or more simply check to see if the address falls in your DHCP range.
How? [ 22. September 2003, 14:42: Message edited by: vavoom ]
|
|
Top
|
|
|
|
#45786 - 2003-09-22 02:53 PM
Re: DHCP and Internet Explorer
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Have a look at the key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\"
Under here are the adaptors defined on your system, and their settings.
To check if the address is in one of your ranges, use one of the many UDFs from the UDF forum.
You are currently checking to see if the service is running. AFAIK this service will normally always be running, even if the adaptor address is statically defined.
Finally, the entries may be persistent - you will have to explicitly remove the entries if you don't want to apply them, i.e.
code:
If DHCP_ASSIGNED_ADDRESS ADD_PROXY_ENTRIES Else DELETE_PROXY_ENTRIES EndIf
Consider adding a little debug code to display whether the proxy entries are being added or removed. It will help a lot in determining where the problem lies.
|
|
Top
|
|
|
|
#45787 - 2003-09-22 03:57 PM
Re: DHCP and Internet Explorer
|
vavoom
Lurker
Registered: 2003-09-22
Posts: 3
|
OK, thanks for the replies. I'm going to figure it out.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 693 anonymous users online.
|
|
|