PC Review


Reply
Thread Tools Rate Thread

Getting IP address from MAC Address

 
 
Jean-Michel Cafagna
Guest
Posts: n/a
 
      18th May 2005
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



 
Reply With Quote
 
 
 
 
Kurt
Guest
Posts: n/a
 
      18th May 2005
You can get these same results using arp -N.


"Jean-Michel Cafagna" <jmcafagna°AT°@hotmail.com> wrote in message
news:428b551a$0$26082$(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Explorer: Address Violation at address xxxxxxxx Read of address xx =?Utf-8?B?UGFzY2Fs?= Windows XP General 3 9th Oct 2006 01:56 AM
IP Address in ipconfig differs from IP Address on IP address checking websites Dano Windows XP Networking 5 28th Apr 2006 09:11 PM
To:Address, I start to type address, saved address comes up I cli. =?Utf-8?B?ZW1waXJlc2luYw==?= Microsoft Outlook Discussion 1 17th Sep 2004 01:14 PM
Outlook 2003 -Duplicating account address in business contact address field Fran Microsoft Outlook Contacts 0 6th Dec 2003 08:51 PM
Clicking on web address lists current address and new address West Windows XP Internet Explorer 0 15th Aug 2003 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:20 AM.