Solved

apple script to collect wired and wireless mac address

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
Set up iPhone and iPad email signatures to always send in high-quality HTML with this step-by step guide.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now