General discussion

Locked

Interrogate Win2k DHCP via script

By BeerMonster ·
I'm working on a retail network consisting of some 800 shops. There are about 6 win2k prof clients in each shop. What I want to do is use wake on lan to bring up any machine on the network that has been switched off (as shop staff are prone to do when they go home). The wake on lan works fine, but what I need is a way of getting the mac addresses for each client from DHCP. Currently, we use getmac from the reskit and have built up a DB of mac addresses, but if I could get that info live from DHCP then there would be no problems with network cards being swapped, or new machines added that have not yet been 'getmac'ed etc. Note- all I'm interested in is how to get the macs from DHCP, no workarounds please ! Any ideas how to do this ?? a cool2000 points to whoever provides the answer.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Interrogate Win2k DHCP via script

by adrian.wilkins In reply to Interrogate Win2k DHCP vi ...

Well, open DHCP goto the scope for your network, clk on address leases and look at the unquie id, this is the mac address.

Collapse -

Interrogate Win2k DHCP via script

by BeerMonster In reply to Interrogate Win2k DHCP vi ...

Thanks, but 800 shops, times approx 6 workstations, equals around 4800 mac addresses - which is why I want to automate it. Ideally I'll use an LDAP query to get a list of machines, and query DHCP using that list.

Collapse -

Interrogate Win2k DHCP via script

by SteveD In reply to Interrogate Win2k DHCP vi ...

I don't know of and can't find any reference to a scripting interface for the DHCP server. However, it does keep logs of all important events, including new leases and lease renewals. The logs are found in the \Winnt\System32\dhcp folder with file names like DhcpSrvLog.Mon, DhcpSrvLog.Tue, etc. (This is in NT 4.0. I imagine Win 2K is about the same.) It should be very easy to parse these logs and get the info you need. They are comma-delimited, where each line contains the following fields:

ID,Date,Time,Description,IP Address,Host Name,MAC Address

The ID is interpreted as:

00 The log was started.
01 The log was stopped.
02 The log was temporarily paused due to low disk space.
10 A new IP address was leased to a client.
11 A lease was renewed by a client.
12 A lease was released by a client.
13 An IP address was found to be in use on the network.
14 A lease request could not be satisfied because the scope's address pool was exhausted.
15 A lease was denied.
20 A BOOTP address was leased to a client.

I hope this helps.

Steve Diamond

Collapse -

Interrogate Win2k DHCP via script

by BeerMonster In reply to Interrogate Win2k DHCP vi ...

Thanks, but not really what I was after...

Collapse -

Interrogate Win2k DHCP via script

by BeerMonster In reply to Interrogate Win2k DHCP vi ...

This question was closed by the author

Back to Windows Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums