[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2338
  • Last Modified:

Who can I export DHCP active lease information


Hello,

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.

Thanks,
Mark
0
markpalinux
Asked:
markpalinux
  • 4
1 Solution
 
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
0
 
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.

Thanks,
Mark
0
 
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.
Cheers.
--Rob
0
 
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>
Example:
dhcpcmd  10.0.123.100  enumclients  10.0.123.0  -h  >C:\Temp\DHCPlist.txt

DHCPcmd is available as part of the NT resource kit:
http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTKit.asp
or
http://www3.ns.sympatico.ca/malagash/Downloads/Net/DHCPCMD.EXE
0
 
Rob WilliamsCommented:
Thanks Mark,
--Rob
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now