Anyone find a way to report the WIFI mac Address

GabeShack
Valued Contributor III

Since upgrading to Casper 9, I am not able to use my custom Mac Address Report that would list out what ever group I had selected with both Ethernet and Wifi Mac Addresses as well as name/serial number. Anyone have a way to do this, maybe with the API tie ins?

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools
7 REPLIES 7

corbinmharris
Contributor

Jamf support provided this script for an extension attribute -

echo "<result>$(system_profiler SPAirPortDataType | awk '/MAC Address:/ {print $NF}')</result>"

GabeShack
Valued Contributor III

Do you know is this compatible with all versions of the system? I only ask since the part of the script lists AirPortDataType and I wondered if this got changed to WiFi.

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

corbinmharris
Contributor

All our Macs are running 10.9.x

Screenshot of Wireless MAC Address displayed in inventory -

http://note.io/1nNplWS

GabeShack
Valued Contributor III

Thanks for this it looks like its working perfectly!

Gabe Shackney
Princeton Public Schools

Gabe Shackney
Princeton Public Schools

stevewood
Honored Contributor II
Honored Contributor II

Only because I hate using system_profiler because it's usually slower, and because there's nine ways to skin a cat:

#!/bin/sh

wifiPort=`networksetup -listallhardwareports | awk '/Hardware Port: Wi-Fi/,/Ethernet/' | awk 'NR==2' | cut -d " " -f 2`
macAddy=`networksetup -getmacaddress $wifiPort | awk {'print $3'}`

echo "<result>$macAddy</result>"

That will work for 10.7 and up.

elosob
New Contributor

hi,

Could you help me with this problem, we have casper 9.1 and i need this option where i can print a report where the Wifi Address is showing. I really new on this, i just started to work on this. Is there a way that you can send me the script and steps how to do it.

Hope you can help me.

Thanks a lot

GaToRAiD
Contributor II

@elosob if you take the script that @stevewood posted and go into JSS and create an extension attribute. This will run when computers checkin with JSS. Then you can create a smart group that will filter out information based on what you are looking for in the extension attribute.

So in a nutshell these are the steps:

1) Create extension attribute a) Go to Computers>Management Settings>Extension Attributes
2) Create yourself an Extension attribute a) make sure that it is set to Data Type: String and InputType:Script
3) Put the script from @stevewood in the box where the script should be.
4) Then go back to Computers
5) Create a smart group and name it whatever you want.
6) In the criteria, you will most likely have to hit all Criteria at the bottom.
7) Once you have selected your criteria being the name of the extension attribute you create, you need to set value.
8) If you want any value that is not null, you can select "not like" and leave the value empty, or you can set "is not" and leave the value empty.
9) Save the smart group, then you can click on View and you have your list.

This might take some time to populate since you just created the extension attribute.