Page 1 of 1 1
Topic Options
#45781 - 2003-09-22 02:03 PM DHCP and Internet Explorer
vavoom Offline
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
#45782 - 2003-09-22 02:25 PM Re: DHCP and Internet Explorer
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
I assume you set "$Dynamicip" to "2" somewhere in your script?

Which part isn't working, checking that a client is using DHCP or setting the proxy values?

Top
#45783 - 2003-09-22 02:30 PM Re: DHCP and Internet Explorer
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Thinking about this a little more, won't the DHCP client service be running even if the machine is configured to statically assign an address?

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.

Top
#45784 - 2003-09-22 02:32 PM Re: DHCP and Internet Explorer
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
What is $Dynamicip?

If we look at -

code:
If $DHCP = $Dynamicip
...

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#45785 - 2003-09-22 02:39 PM Re: DHCP and Internet Explorer
vavoom Offline
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 Offline
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 Offline
Lurker

Registered: 2003-09-22
Posts: 3
OK, thanks for the replies. I'm going to figure it out.
Top
#45788 - 2003-09-22 09:33 PM Re: DHCP and Internet Explorer
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Pleas enlighten us as to what the problem/solution was.
_________________________
There are two types of vessels, submarines and targets.

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 693 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.093 seconds in which 0.067 seconds were spent on a total of 12 queries. Zlib compression enabled.

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