Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to export the DHCP content to a text file in Windows 2003 Server?

Posted on 2007-04-11
3
Medium Priority
?
675 Views
Last Modified: 2010-05-18
Dear all experts,

I'm using Windows 2003 Server as my DHCP server and I reserve a lot of IP by using MAC address on it.  Now I would like to export it to a text file for filing purposes.  As I know that I can use "netsh dump dhcp > dhcp.txt" command to export it in Windows 2000 environment, but now it seems not possible because all contents inside become a garbage characters.

Please kindly help.

Regards,
0
Comment
Question by:towo2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 26

Expert Comment

by:Pber
ID: 18888940
That should work in 2003 as well.  maybe there is something corrupt in your dhcp database.  The only other way I can think of to extract this info would be to use API programming or powershell.

What kind of garbage characters are you getting?
0
 
LVL 30

Accepted Solution

by:
LauraEHunterMVP earned 1000 total points
ID: 18888945
What is the full command that you're using?

netsh dhcp server \\servername dump > dhcp.txt returns human-readable output from a 2003 DHCP server like the following snippet:



# ==============================================================
#  Configuration Information for Server 10.2.2.5                  
# ==============================================================



# =====================================
#     Add Classes                      
# =====================================

Dhcp Server 172.17.2.66 Add Class "Default Routing and Remote Access Class" "User class for remote access clients" 525241532e4d6963726f736f6674 0 b
Dhcp Server 172.17.2.66 Add Class "Default BOOTP Class" "User class for BOOTP Clients" 424f4f54502e4d6963726f736f6674 0 b
Dhcp Server 172.17.2.66 Add Class "Microsoft Windows 2000 Options" "Microsoft vendor-specific options for Windows 2000 Clients" 4d53465420352e30 1 b
Dhcp Server 172.17.2.66 Add Class "Microsoft Windows 98 Options" "Microsoft vendor-specific options for Windows 98 Clients" 4d534654203938 1 b
Dhcp Server 172.17.2.66 Add Class "Microsoft Options" "Microsoft vendor-specific options applicable to Windows 98 and Windows 2000 Clients" 4d534654 1 b
Dhcp Server 172.17.2.66 Add Class "TFTP Server" "Voice TFTP Server" 1500 1 b

# =====================================
#     Add Classes  End                
# =====================================
0
 
LVL 4

Expert Comment

by:Mark Walden
ID: 18939148
Run this command from the DHCP server command prompt.
netsh dhcp server scope 192.168.1.0 show clients >>ClientLeases.txt

Example: c:\ netsh dhcp server scope 192.168.1.0 show clients >>ClientLeases.txt

This will create a text file called ClientLeases.txt on the C: drive.
It will contain all lease info for that scope.

If you have multi scopes you will need to change the scope address and run the command again.  Or create a batch file with the same command but different scope ID (192.168.1.0).  The ">>" is important to the command because it adds info to the text file, does not overwrite it each time.

Use this command if you only want reservation info for the scope.
netsh dhcp server scope 192.168.1.0 show reservedip >>ReservedIPs.txt
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question