Jump to content

My Own DHCP option


jeff.sadowski

Recommended Posts

On my windows server I added my own option. I added an option 252 and called it start-script; it is a string option and I gave it a UNC path to a script that I want my xp machines to run.

I know how to use gpo's to pass startup scripts but I wanted a server managed way to pass options to xp machines that will be running from cd.

To test I am using a regular xp machine and trying to get it to see my new option.

I tried following the instructions here http://support.microsoft.com/kb/312468

I added the 252 key under HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\DHCP\Parameters\Options

I added the DWORD KeyType and found elsewhere that the KeyType 0x1 is for strings

So I set KeyType to 0x1

I created a REG_SZ RegLocation and gave it a registry path system\currentcontrolset\services\tcpip\parameters\start-script

then I created that string in the registry

I then tried rebooting but

HKEY_LOCAL_MACHINE\system\currentcontrolset\services\tcpip\parameters\start-script

didn't have the UNC path that I was passing from my dhcp server.

Reading further down on http://support.microsoft.com/kb/312468 I think I may need to compile code to have it read that option?

I am not opposed to creating a small program to get that option but didn't understand what exactly I needed to do. If I can do this all with dos scripting I'd perfer to. I understand batch scripting best of windows scripting. but if I need to use cscript I understand that as well. I understand C code well but I'm not sure I'd be able to compile what I wanted given I only have gnu tools to compile it.

I'm not looking for another way to do this. I am looking for how to use my own dhcp options in windows.

Link to comment
Share on other sites


Are you sure this is even an option anymore? That kb talks about Windows 2000 and NT4.

Anyways, it could be possible that the PC can't get the info at the time the script is run because of NIC delays. Perhaps you can change your script to do a loopback ping for 16 seconds first before trying to get any info from the server.

But I see DHCP Option 252 refers to ISA running on the DHCP server. Is this also true in your case?

http://technet.microsoft.com/en-us/library/cc713344.aspx

Link to comment
Share on other sites

Option 252 is for WPAD, which is a jscript language script that browsers can run (and you're somewhat limited in functions that can run as wpad scripts). These are also only parsed as proxy routing scripts - it's not something you can "force" the client to run at any other time, plus the browser in question must support running proxy pac scripts assigned via WPAD (not all can, although most major browsers do). Option 252 will not work for what you want it to, not to mention the WPAD script won't be requested until the first time the browser needs it, when making it's first request for a site.

To do this, you're going to need to create your own option, and write a program that can use the data passed down via that option - option 252 is a well-known option, and really only works as I mentioned above. You *could* potentially use it, but you're likely to break web browsing using a browser that checks option 252 if you do, so I wouldn't recommend it.

Link to comment
Share on other sites

Fine I'll use another option maybe 1023 or some other if this one is taken as well. As far as I know only up to 249 is the highest option that is even listed without adding your own. Doesn't matter my question wasn't about WPAD or ISA I just want to know how to pull in this option into windows. I want to know how to run the DhcpRequestParams from vbscript. Can this be done. It looks like I do need to run DhcpRequestParams. Or can I compile windows system calls from gnu tools.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...