Skip to main content

With 15.6 and beta macos 26

The EA I was using for report back a macs SSID is now broken/blocked.

Does any happed to have one that will works?

 

Thanks

 

#!/bin/sh

# Jamf Extension attribute to return SSID
#
# Check for SSID name
wifi_name=$(ipconfig getsummary en0 | awk -F ' SSID : ' '/ SSID : / {print $2}')

# Check if SSID is found
if [ -z "$wifi_name" ]; then
    result="No Wi-Fi network found."
else
    result="$wifi_name"
fi

# Result for Jamf
echo "<result>$result</result>"

 

 

 

 

BigMacAdmin on Slack suggested this command: 

/usr/libexec/PlistBuddy -c 'Print :0:_items:0:spairport_airport_interfaces:0:spairport_current_network_information:_name' /dev/stdin <<< "$(system_profiler SPAirPortDataType -xml)" 2> /dev/null

This however takes a few seconds to run, so if anyone finds a better way please share.



Here is the script for the EA if anyone needs it.
 

#!/bin/bash

# Jamf Extension attribute to return SSID

#

# Get the current Wi-Fi SSID using system_profiler and PlistBuddy

wifi_name=$(/usr/libexec/PlistBuddy -c 'Print :0:_items:0:spairport_airport_interfaces:0:spairport_current_network_information:_name' /dev/stdin <<< "$(system_profiler SPAirPortDataType -xml)" 2> /dev/null)

# Check if SSID is found

if [ -z "$wifi_name" ]; then

    result="No Wi-Fi network found."

else

    result="$wifi_name"

fi

# Result for Jamf

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

 


Here is an updated script that works for macOS 26 devices, seems Apple will change the ability to get the SSID via terminal and will most likely remove it at some point. 

#!/bin/bash

# Enable verbose mode for ipconfig
sudo ipconfig setverbose 1

# Get the current SSID and display it for interface en0
SSID=$(ipconfig getsummary en0 | awk -F ' SSID : ' '/ SSID : / {print $2}')

# Check if SSID is found
if [ -n "$SSID" ]; then
echo "Connected SSID: $SSID"
else
echo "SSID not found or not connected."
fi

# Result for Jamf
echo "<result>$SSID</result>"

Enjoy!


Might also be a good idea to follow that with a “sudo ipconfig setverbose 0” to restore the redaction.