Solved

apple script to collect wired and wireless mac address

Posted on 2009-05-11
4
869 Views
Last Modified: 2013-11-12
i'm sort of new to apple desktops and laptops, and looking for a way to collect the mac address of the wired and wireless network card of our machines, and then dump it to a text file on a file share, or email.

i know how to do it using a batch file in windows but obviously that wont work in os x.

any help would be greatly appreciated

thanks
0
Comment
Question by:jcox3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:AGoodKeenMan
ID: 24359258
If you happy using the Terminal, you might want to have a look at the man page for system_profiler, i think it will output information to an xml file. Let me know if this helps, if not I can work something.
0
 
LVL 9

Accepted Solution

by:
heteronymous earned 500 total points
ID: 24360698
system_profiler can do it, but the output is going to be pretty verbose and with alot of extra(neous) info to parse.

You can get the info more directly via (the shell/bash) networksetup

We need to know a bit more about the hardware - namely, any MacPro towers ?
If not, (barring some really old machines) then they'll likely have only one (built-in) Ethernet port.

In which case you could use

sudo networksetup -getmacaddress Ethernet
sudo networksetup -getmacaddress AirPort

the rest is up to you to research and implement,
Apple's document on AppleScript and shell script interaction is here:

http://developer.apple.com/technotes/tn2002/tn2065.html
0
 
LVL 5

Expert Comment

by:AGoodKeenMan
ID: 24360998
Nice work. heteronymous is right, networksetup is a much better fit.
sudo networksetup -listallhardwareports > $HOME/Desktop/NetworkInfo.txt
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We could spend the next millennium discussing the differences of the Mac and Windows platforms. The next century will continue to have fanatics on both side of the equation and neither side will win the war. However, that’s not why we are here. W…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question