I found an extension attribute on the JAMF Extension Attribute site but it doesn't work as I would expect it to, probably because we aren't using Managed Preferences. We would like to be able to report back if the guest account is enabled or disabled, in an extension attribute. I thought this would be fairly easy but can't find a solution on JAMF Nation and via Internet Searches. Any help is appreciated.
Just in case anyone see's this many years after and tries the script...it needs a few adjustments.
Adjust the line:
result=/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled
You need to surround it with
$() to get the result
Final Script being:
#!/bin/sh result=$(/usr/bin/defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled) if [ "$result" == "0" ]; then echo "<result>Disabled</result>" else echo "<result>Enabled</result>" fi