Windows – DHCP Reservations, SERVER 2003, easy way to Export txt\csv\xml

dhcpwindows-server-2003

I have a list of DHCP reservations, Server 2003.
I want to export (in all it is) a list of IP, MAC address.
I need the list for view: sorting\store in of DB for later Query, not for importing later. and therefore this command:

netsh dhcp server export c:\1.txt all

Not good for me, because I can not read the file (I'm only human …), there is another way to export or easy way to read this file?

(I do not care to write code to parse file but I could not understand how it is written).

Best Answer

How do I export DCHP reservation in a readable form?

You can use the dump option of netsh to "export" the data as plain text.

Use the following command

netsh dhcp server \\ServerName dump all > c:\1.txt

Note:

The \\ServerName parameter is optional and can be left unspecified if you are performing commands locally at the DHCP server. If the server being managed is remote, this parameter is required, and the name of the server must be specified.

Source Use DHCP commands interactively at the command prompt


Create a readable DHCP export

Now this works almost the same as an export, but the format is different (ASCII), so it can be read, but you cannot use this for import.

The command is slightly different and is now:

netsh dhcp server \\ServerName dump all > d:\backup_DHCP_servernamedump.txt

Opening this file in notepad for example will show a plain text scope of the export.

Source Exporting a (readable) DHCP scope

Related Question