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 f -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 i -z "$wifi_name" ]; then

    result="No Wi-Fi network found."

else

    result="$wifi_name"

fi

# Result for Jamf

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