Windows – DHCP lease information to file

dhcpnetshtext;windows

Is there a command where I can convert the mac address column of the DHCP lease to txt file or CSV?
I am setting up mac filtering on a wireless controller but just want to use copy and paste instead of typing out each MAC address.
Maybe a netsh or something?

It is a 2003 server.

Best Answer

On Windows 2003 you can use the netsh command to get information from the dhcp server

@echo off
set server=dhcpsrv1
set scope=192.168.0.0
netsh dhcp server \\%server% dump > %server%.dump.txt
netsh dhcp server \\%server% scope %scope% show clients 1 > %server%.%scope%.txt