Solved

apple script to collect wired and wireless mac address

Posted on 2009-05-11
4
859 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
A lot of new and distinct gadgets are making their appearance every other day. The latest gadget that has wooed the attention of all gadget lovers and non gadget lovers alike is the Smartwatch. This tiny gadget is capable of offering live access to …
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 …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 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