Wednesday, November 08, 2006
We all know the DHCP console sucks for searching. The columns don't sort accurately and it's hard to find a specific system, especially in a large scope. Netsh to the rescue!
Find a reservation
netsh -r servername dhcp server scope scopeaddress dump | find /i "searchvalue"
servernameis the name or IP address of the DHCP server on which the scope is defined,
scopeaddressis the IP address of the scope in question, and
searchvalueis the client IP address, MAC address (undelimited), computer name or text description (/i ignores case).
netsh -r dhcpsvr1 dhcp server scope 192.168.100.0 dump | find /i "aaron-laptop"
dhcp Server 192.168.1.1 Scope 192.168.100.0 Add reservedip 192.168.100.42 01234567890a "aaron-laptop." "Aaron Czechowski" "BOTH"
Find a lease
netsh -r servername dhcp server scope scopeaddress show clients | find /i "searchvalue"
searchvalueoptions: IP address, MAC address (hyphen delimted).
netsh -r dhcpsvr1 dhcp server scope 192.168.100.0 show clients | find /i "01-23-45-67-89-0a"
192.168.100.42 - 255.255.255.0- 01-23-45-67-89-0a -11/11/2006 8:05:23 PM -D