473,796 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding MAC Address

Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the
target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command (all
within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline .com

"To the Glory of God, The Father"

Nov 15 '05 #1
2 3289
Rick,

You can make a call to the GetIpNetTable function in the IP Helper API.
It will allow you to get the IP to MAC-address mapping table. You can also
call the SendARP function to make a request for the MAC address for a
particular IP address.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"FR3AK" <tr******@paiin dustries.com> wrote in message
news:Oc******** ******@tk2msftn gp13.phx.gbl...
Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the
target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command (all within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline .com

"To the Glory of God, The Father"

Nov 15 '05 #2
Thanks for your help.

I believe the SendARP only works on win2k machines and above, so i'll try
the GetIpNetTable function as you mentioned. :)

The code i have is working, but it's taking about 2 minutes to query an
entire subnet....i'm sure there's a better way to do this.

Thanks again for your response.
--
Rick King
rk***@royaline. com

"To the Glory of God, The Father"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:Oj******** ******@TK2MSFTN GP12.phx.gbl...
Rick,

You can make a call to the GetIpNetTable function in the IP Helper API. It will allow you to get the IP to MAC-address mapping table. You can also call the SendARP function to make a request for the MAC address for a
particular IP address.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"FR3AK" <tr******@paiin dustries.com> wrote in message
news:Oc******** ******@tk2msftn gp13.phx.gbl...
Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command

(all
within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline .com

"To the Glory of God, The Father"


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2208
by: Picture Dots | last post by:
Ok - I want to check a string for @ in it (Im checking to see if a string that should contain an email holds a @ ) How would I go about this? preg_match? ereg? strstr?Examples? Also - how would I find any non alpha numeric characters in a string so I can give the user an error message. I dont want any characters besides alpha-numeric in the strings.
2
7132
by: Antitax | last post by:
I have a database with more than 800 adress records Some of the are similar because some letters in the street adress for example are not identical, altough they point to the same adress. Does anyone have the syntax for a query that shows similar adresses thar could be duplicates? Thank you
9
1715
by: Lauren Wilson | last post by:
Hi Folks, We've been using Crypto ++32 to control licensed access to our widely distributed Access 2K app. Unfortunately, Sampson Multimedia appears to be out of business. Does anyone out there have recommendations for an alternate method of locking our MDE files to allow only licensed access? We simply want to allow the user to install the program and get a
1
1229
by: | last post by:
Hello, I'm keping myself busy here by investigating the world of LDAP and Active Directory. I have an application which allows users from the system to be selected from a list box and as a result their mail address (as set in AD) is returned. This is all fine untill I try to show the address of a user who doesn't have one. In esscense, the DirectorySearcher.FindAll isn't finding any. Here's a copy of what I have:
2
1829
by: Lad | last post by:
Did anyone try to find out a regular expression for finding an email address in a text? Thank you for the reply L.
11
26304
by: axlq | last post by:
Does anyone have a favored way of finding the geographic location of a user's IP address, so that a php script can include content relevant to that location? Reverse-lookup of the hostname isn't reliable and often doesn't work, especially if the returned hostname ends with .com, .net, ..info, .biz or other tld that doesn't reveal geographic location. I also see a bunch of commercial services that offer a "country whois" function for a...
17
3790
by: abhimanyu.v | last post by:
Hi Guys, I have one doubt. The test program is given below. It uses two way of finding out the offset of a variable in structure. I executed the program and found the same result. My question is what is difference between 1) (unsigned long) &((struct foobar *)0)->foo and
5
2062
by: Timothy Grant | last post by:
On Tue, Aug 5, 2008 at 2:50 PM, David York <davideyork@gmail.comwrote: I'm not sure what you are trying to accomplish. The machine I'm typing this on has a 192.168.x.x number. The router that gave it to me also has a 192.168.x.x number. However, I know that that is not the IP that the world sees when my packets finally leave the building. What if your machine has multiple interface cards in it? What are you trying to accomplish?
275
12417
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5453
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.