Hi!
Has anyone managed to get information about the iMac computer's SSID running MacOS BigSur via extensions attribute. If so, how did you do it?
Regards
Hi!
Has anyone managed to get information about the iMac computer's SSID running MacOS BigSur via extensions attribute. If so, how did you do it?
Regards
Hello,
This is what I have been using to get this information, it works on both M1 and Intel macs as well as all MacOS versions.
#!/bin/sh
##Get the wireless port ID
WirelessPort=$(networksetup -listallhardwareports | awk '/Wi-Fi|AirPort/{getline; print $NF}')
##Collect new preferred wireless network inventory and send back to the JSS
PreferredNetworks=$(networksetup -listpreferredwirelessnetworks "$WirelessPort" | sed 's/^ //g')
echo "<result>$PreferredNetworks</result>"
The results look like this
Preferred networks on en1:
Wireless1
Wireless2
Hello,
This is what I have been using to get this information, it works on both M1 and Intel macs as well as all MacOS versions.
#!/bin/sh
##Get the wireless port ID
WirelessPort=$(networksetup -listallhardwareports | awk '/Wi-Fi|AirPort/{getline; print $NF}')
##Collect new preferred wireless network inventory and send back to the JSS
PreferredNetworks=$(networksetup -listpreferredwirelessnetworks "$WirelessPort" | sed 's/^ //g')
echo "<result>$PreferredNetworks</result>"
The results look like this
Preferred networks on en1:
Wireless1
Wireless2
Big thanks for sharing your script. Do you or someone else have any a clue how to to send back to JSS current wireless SSID which Mac use at the moment ?
Big thanks for sharing your script. Do you or someone else have any a clue how to to send back to JSS current wireless SSID which Mac use at the moment ?
Here's the script that we use for the current SSID connected to:
#!/bin/sh
# Jamf Extension attribute to return SSID
result=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'`
echo "<result>$result</result>"
Here's the script that we use for the current SSID connected to:
#!/bin/sh
# Jamf Extension attribute to return SSID
result=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | awk '/ SSID/ {print substr($0, index($0, $2))}'`
echo "<result>$result</result>"
I confirm that it also works on iMac and MacBook with BigSur. Wonderful people - thanks.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.