Who can I export DHCP active lease information


I want to start using WOL "Wake on Lan Software" and need to find all of the MAC addresses for my active machines - we use DHCP running on Windows 2003 SP1 - so I figure an export from there is the best method to keep my mac list up to date.
I tried to look at netsh dhcp but that didn't appear to be able to give me the active lease info.

Please let me know exactly how I can export the macs from the windows 2003 dhcp server.

I can use cmd, vbscript, any resource kit tools, any free 3rd party tools for this - I want to avoid having to run an audit from the client side, etc.

LVL 15
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rob WilliamsCommented:
You can simply open the server's management console, expand the server, expand the scope, right click on "Address leases" and choose export. It will export a list of FQDN's, IP's and MAC's
markpalinuxAuthor Commented:
Sorry, I need an automated solution. I have 20+ dhcp scopes on different servers and want a nightly job (or as needed) to export the data.  

Again sorry for not making that clear.

Rob WilliamsCommented:
Sorry, looked rather obvious but.... <G>
I would think it be relatively easy to extract with a query using VBS, but my VBS skills are almost nil.
Rob WilliamsCommented:
If you are still in need of a solution I found a great little tool in the Windows NT Resource kit and tested it on a 2003 server, called DHCPcmd.exe. It can be run from the server or a remote computer, and could be simply inserted in a  'clickable' batch file, or added to a scheduled event, with one line per scope. It will export a basic list with IP computer name and MAC address, or you can choose verbose mode with complete DHCP information for each assigned IP.  The exported delineated file is quite readable as a .txt file or can be opened in Excel or with a database application.
Syntax is:
dhcpcmd  <IP Address of server>  enumclients <Scope network ID>  -<h or v option> > <path to result file>
dhcpcmd  enumclients  -h  >C:\Temp\DHCPlist.txt

DHCPcmd is available as part of the NT resource kit:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob WilliamsCommented:
Thanks Mark,
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.