Solved

apple script to collect wired and wireless mac address

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cancelling Pandora on iPhone 8 57
User Permissions on OS X 10.12 Sierra 3 124
apple tv fire 15 40
I need to text message (iPhone) from my MacBook 3 4
The error "There was an error performing the update" occurred on a Mac OS X client workstation running  Symantec AntiVirus for Mac (http://www.symantec.com/business/products/purchasing.jsp?pcid=pcat_security&pvid=825_1) - the Enterprise product vers…
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 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

13 Experts available now in Live!

Get 1:1 Help Now