I work in an environment that utilizes OS X Server's NetBoot and NetRestore on a daily basis for preparing Macs for resale. I am working on a new, custom image for a customer that has a special request.

Instead of a simple netrestore of their desired configuration, they want us to collect the Mac Addresses and Serial numbers of all of the machines, and send it to them in an excel file. I am struggling with collecting this information in any automated way. We would look into Mac auditing software if this were a regular occasion, but this is only 40-50 units, a relatively small number for us, so it's basically a one-off. We would also consider using something like Apple Remote Desktop (ARD) for this, but we are regularly NetBooting or NetRestoring many other devices, so distinguishing what devices are part of this batch, and which ones aren't may prove to be difficult.

I see that in terminal there are ways to extract the serial numbers (and presumably mac addresses. this link provides an example of a script that collects serial number and model number http://community.spiceworks.com/topic/403719-mac-shell-scripting-naming-macs-based-on-what-model-they-are), but is there a way that with a similar script, just the serial and mac addresses can be appended to a log on a file share on the network? I want to limit the user interaction as much as possible to automate this process. I need it to be fool-proof as we have helpers that will be assisting us perform the restores that aren't as savvy, and we want it to be faster than going into system profiler and saving it that

TL;DR Anyone have any ideas on how to automatically collect Mac Addresses and serial numbers to a file for 40+ machines while netbooted or during a netrestore?

  • ARD is the tool I'd use. For 40 machines or even 100, It's not likely that rolling your own code would make sense or trying to reinvent the wheel Apple provides for this sort of bulk collection and exporting to a spreadsheet.
    – bmike
    Commented Aug 25, 2014 at 17:27
  • Well, in the research I've done, I've found that appending a log with the serial number is as simple as
    – David Go
    Commented Aug 25, 2014 at 17:47
  • Well, I've found that appending a log with the serial number is as simple as "ioreg -l | awk '/IOPlatformSerialNumber/ { split($0, line, "\""); printf("%s\n", line[4]); }' >> file.txt" but I'm not well versed enough to get the serial number and mac address in an easy to parse way. That is to say, i can append the logs, but i have no spaces or commas to separate the values, and extracting the data that way would be hell. I am toying with automator to see if it will do the trick. ARD's (I think) not an option due several unrelated to the many other unrelated Macs being restored at the same time
    – David Go
    Commented Aug 25, 2014 at 17:58
  • Yes - if you know how to shell script, then you have lots of options. Fool proof is going to make answering this difficult. Perhaps you can read our software recommendations Ask Different Meta to refine what you really need and what is optional? meta.apple.stackexchange.com/questions/2180/…
    – bmike
    Commented Aug 25, 2014 at 19:09


You must log in to answer this question.

Browse other questions tagged .