locked
How to export DHCP adress list to text file

    Question

  • Hello all

    As per requiremtns we have to monitor the DHCP chages(added,chaged IP's) inDHCP list.
    I want command/programm for export DHCP adress list which having IPadress,Client Name  etc.

    Thanks in Advance

     


    SNIVAS
    Tuesday, February 09, 2010 5:20 AM

Answers


  • dhcpcmd <IPAddress> enumclients <ScopeNetAddress> -<option> > <Path\textfile.txt>

    here . .

    IPAddress is the IP address of the DHCP server.
    ScopeNetAddress is the network address of the DHCP scope.

    option (-v or -h)
    -v: Lists detailed lease information
    -h: Lists lease information with hardware information

    textfile.txt is the name of the destination file.

    don't miss the > (thats the output redirector) b4 the file name where the data will be written
    • Proposed as answer by AAKIB Tuesday, February 09, 2010 9:17 AM
    • Marked as answer by Miles ZhangModerator Monday, February 15, 2010 7:18 AM
    Tuesday, February 09, 2010 9:16 AM
  • Hi,

    Thanks for the post.

    The dhcpcmd command is not included in Windows Server 2000/2003. We could obtain it from Windows NT 4.0 Resource Kit Support Tools currently.

    Windows NT 4.0 Resource Kit Support Tools
    http://www.microsoft.com/downloads/details.aspx?FamilyID=3E972E9A-E08A-49A2-9D3A-C0519479E85A&displaylang=en

    Based on my test, it can work properly on Windows Server 2000/2003.

    For more information about dhcpcmd, please refer to the following KB article:

    How to Use the Dhcpcmd.exe Tool Included with Support Tools
    http://support.microsoft.com/kb/232213

    Hope this helps.
    Wednesday, February 10, 2010 10:12 AM

All replies

  • Hello

    User should be Local Administrator group and run below command

    C:> Netsh DHCP server export C:\dhcpdb.txt ALL

    Is above coomand is ok or any body have suggestions.
    Please suggest.
    SNIVAS
    Tuesday, February 09, 2010 6:07 AM

  • dhcpcmd <IPAddress> enumclients <ScopeNetAddress> -<option> > <Path\textfile.txt>

    here . .

    IPAddress is the IP address of the DHCP server.
    ScopeNetAddress is the network address of the DHCP scope.

    option (-v or -h)
    -v: Lists detailed lease information
    -h: Lists lease information with hardware information

    textfile.txt is the name of the destination file.

    don't miss the > (thats the output redirector) b4 the file name where the data will be written
    • Proposed as answer by AAKIB Tuesday, February 09, 2010 9:17 AM
    • Marked as answer by Miles ZhangModerator Monday, February 15, 2010 7:18 AM
    Tuesday, February 09, 2010 9:16 AM
  • Hello AAKIB

    C:\> dhcpcmd
    It is showing an error "dhcpcmd not recogized as internal or external command .........."

    I am working with windows OS 2000/2003/.....

    in our senario

    Application will running on client mechine and It will connect to DHCP server and suppose collect the inforamtion which is releated to DHCP 
    SNIVAS
    Wednesday, February 10, 2010 6:49 AM
  • Hello Snivas...
    this tools is packeged under windows 2000 resourcekit tools... however you can follow the link to download just this utility rather than having the entire bundle...you can use it in both environment (2000/2003):

    http://www.dynawell.com/download/reskit/microsoft/win2000/dhcpcmd.zip

    Run this tool on server where DHCP is configured...not from any other box
    If you want periodical and automated dump...create a batch file with the command I posted...and make a scheduled job with an interval as you desire..

    cheers..
    akib

    Wednesday, February 10, 2010 10:00 AM
  • Hi,

    Thanks for the post.

    The dhcpcmd command is not included in Windows Server 2000/2003. We could obtain it from Windows NT 4.0 Resource Kit Support Tools currently.

    Windows NT 4.0 Resource Kit Support Tools
    http://www.microsoft.com/downloads/details.aspx?FamilyID=3E972E9A-E08A-49A2-9D3A-C0519479E85A&displaylang=en

    Based on my test, it can work properly on Windows Server 2000/2003.

    For more information about dhcpcmd, please refer to the following KB article:

    How to Use the Dhcpcmd.exe Tool Included with Support Tools
    http://support.microsoft.com/kb/232213

    Hope this helps.
    Wednesday, February 10, 2010 10:12 AM