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
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