I found this script for collection whether Location Services is enabled, but it's for OSX. I'm super new to Macs as well as scripting, so I'm wondering what would need to be updated to get it working for Big Sur.
<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>Location Services</displayName>
<description/>
<dataType>string</dataType>
<scriptContentsMac>#!/bin/bash
uuid=$(system_profiler SPHardwareDataType | grep "Hardware UUID" | awk '{print $3}')
domain="/var/db/locationd/Library/Preferences/ByHost/com.apple.locationd.${uuid}"
plist="${domain}.plist"
if [[ -f "${plist}" ]]
then
status=$(defaults read "${domain}" LocationServicesEnabled)
if [[ "${status}" == "1" ]]
then
result="Enabled"
else
result="Disabled"
fi
else
result="Unavailable"
fi
echo "<result>${result}</result>"</scriptContentsMac>
<scriptContentsWindows/>
</extensionAttribute>

