[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Export all DHCP leases to text file - how?

Posted on 2010-11-17
4
Medium Priority
?
13,564 Views
Last Modified: 2012-05-10
Hi all and thanks for your help in advance.

I am trying to get a list of all the address leases we have across multiple DHCP scopes in our environment.

When I run the below command it only gives me a list of the scopes but not the address leases within the scope.

netsh dhcp server show scope show clients > scopelist.txt

As we have over 60 scopes within our environment I do not want to have to go to each scopes address leases manually and select export list.

Can anyone suggest a script that will go through all the DHCP scopes and export the address leases into one master list?

Thanks
0
Comment
Question by:EUDS
[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
4 Comments
 
LVL 7

Accepted Solution

by:
Dusan_Bajic earned 1000 total points
ID: 34163626
This .bat should do the work:

For /F "skip=5 delims= " %%a IN ('netsh dhcp server \\dhcpservername show scope') DO (
	if not %%a == Total (if not %%a == Command netsh dhcp server \\dhcpservername scope %%a show clients >> %%a.txt)
)

Open in new window

0
 
LVL 6

Assisted Solution

by:ipajones
ipajones earned 1000 total points
ID: 34206516
Add a "1" on the end of the netsh command to see detailed output i.e.

netsh dhcp server \\server_name scope scope_name show clients 1

Open in new window


You can also do the same in Dusan_Bajic's script to capture details of all scopes.
0
 
LVL 71

Expert Comment

by:Qlemo
ID: 34421431
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

649 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