Can I query my windows 2003 dhcp server from my windows xp in order to get the ip address if i have the mac address or otherwise.

link|improve this question

60% accept rate
feedback

1 Answer

up vote 3 down vote accepted

For a windows 2003 server query:

netsh dhcp server <type.srvIP.here> scope s.s.s.s show client | find "clientIP"
netsh dhcp server <type.srvIP.here> scope s.s.s.s show client | find "MACAddress"

You'll need to know the scope (s.s.s.s) in which this client is on, to show scopes:

netsh dhcp server <type.srvIP.here> show scope

Why not just query your network switch for it though?:

arp -a "clientIP"
arp -a | find "MACAddress"
link|improve this answer
The command arp -a don't work because my network has many vlans seperated by routers. I want to search an ip address which is in an other vlans. For the netsh command, i try to create a script to do this remotely from a desktop not directly on my dhcp servers. On my xp i don't have the context dhcp in netsh. – Adrien Aug 7 '09 at 9:55
Ah, yes. Windows XP's netsh is a bit limited, unfortunately I don't know if it's possible to extend it (might be a good SF question. At least for finding the MAC address of a windows host, you can use nbtstat -A "hostIP". – l0c0b0x Aug 7 '09 at 10:44
1  
Thank you for the nbtstat command, it will help me a lot. The best would be to do the opposite, but I think it will be enough to make my script. – Adrien Aug 7 '09 at 11:50
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.