Getting IP address from MAC Address

  • Thread starter Jean-Michel Cafagna
  • Start date
J

Jean-Michel Cafagna

Previous Message had wrong title
Hi all,

I have a question for you,

I'm looking for a way to have the IP address corresponding to a MAC address

I've found this piece of code ( vbs was the original extension ) which gives
me the local IP address but I would like to enter a MAC address ( like
00-01-02-03-04-05 ) and then I would like in return the corresponding IP
address of the remote computer.

I'm not looking for code that gives me the MAC from an IP ( ping 1.1.1.1 and
arp -a will gives the answer)



strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery("Select IPAddress from
Win32_NetworkAdapterConfiguration where IPEnabled = TRUE")
For Each IPConfig In IPConfigSet
If Not IsNull(IPConfig.IPAddress) Then
For i = LBound(IPConfig.IPAddress) To UBound(IPConfig.IPAddress)
WScript.Echo IPConfig.IPAddress(i)
Next
End If
Next


Thanks for your help
J-Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top